public abstract class FtpConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
protected long |
delayLimit
Delay in ms between two checks
|
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
|
Constructor and Description |
---|
FtpConfiguration(Class<?> classtype,
Class<? extends BusinessHandler> businessHandler,
Class<? extends DataBusinessHandler> dataBusinessHandler,
org.waarp.common.file.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
|
String |
getBaseDirectory() |
int |
getBLOCKSIZE() |
int |
getCLIENT_THREAD() |
Class<? extends DataBusinessHandler> |
getDataBusinessHandler() |
static long |
getDATATIMEOUTCON() |
long |
getDelayLimit() |
org.waarp.common.file.FileParameterInterface |
getFileParameter() |
File |
getFileProperty(String key) |
FtpInternalConfiguration |
getFtpInternalConfiguration() |
FtpSession |
getFtpSession(io.netty.channel.Channel channel,
boolean active)
Return and remove the FtpSession
|
FtpSession |
getFtpSessionNoRemove(io.netty.channel.Channel channel,
boolean active)
Return the FtpSession
|
int |
getIntProperty(String key) |
Lock |
getLock() |
long |
getMaxGlobalMemory() |
abstract int |
getNextRangePort()
Return the next available port for passive connections.
|
Object |
getProperty(String key) |
int |
getSERVER_THREAD() |
String |
getServerAddress() |
long |
getServerChannelReadLimit() |
long |
getServerChannelWriteLimit() |
long |
getServerGlobalReadLimit() |
long |
getServerGlobalWriteLimit() |
int |
getServerPort() |
org.waarp.common.utility.WaarpShutdownHook.ShutdownConfiguration |
getShutdownConfiguration() |
String |
getStringProperty(String key) |
long |
getTIMEOUTCON() |
String |
getUniqueExtension() |
boolean |
hasFtpSession(InetAddress ipOnly,
InetSocketAddress fullIp)
Test if the couple of addresses is already in the context
|
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 |
setBaseDirectory(String dir) |
void |
setBLOCKSIZE(int bLOCKSIZE) |
void |
setCLIENT_THREAD(int cLIENT_THREAD) |
static void |
setDATATIMEOUTCON(long dATATIMEOUTCON) |
void |
setDeleteOnAbort(boolean deleteOnAbort) |
void |
setFileProperty(String key,
File f) |
void |
setIntProperty(String key,
int i) |
void |
setMaxGlobalMemory(long 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 |
setSERVER_THREAD(int sERVER_THREAD) |
void |
setServerAddress(String address) |
void |
setServerPort(int port) |
void |
setShutdown(boolean isShutdown) |
void |
setStringProperty(String key,
String s) |
void |
setTIMEOUTCON(long tIMEOUTCON) |
protected long serverGlobalWriteLimit
protected long serverGlobalReadLimit
protected long serverChannelWriteLimit
protected long serverChannelReadLimit
protected long delayLimit
public FtpConfiguration(Class<?> classtype, Class<? extends BusinessHandler> businessHandler, Class<? extends DataBusinessHandler> dataBusinessHandler, org.waarp.common.file.FileParameterInterface fileParameter)
classtype
- OwnerbusinessHandler
- class that will be used for BusinessHandlerdataBusinessHandler
- class that will be used for DataBusinessHandlerfileParameter
- the FileParameterInterface to usedpublic String getStringProperty(String key) throws FtpUnknownFieldException
key
- FtpUnknownFieldException
public int getIntProperty(String key) throws FtpUnknownFieldException
key
- FtpUnknownFieldException
public File getFileProperty(String key) throws FtpUnknownFieldException
key
- FtpUnknownFieldException
public Object getProperty(String key) throws FtpUnknownFieldException
key
- FtpUnknownFieldException
public int getServerPort()
public String getServerAddress()
public long getServerGlobalWriteLimit()
public long getServerChannelWriteLimit()
public long getServerGlobalReadLimit()
public long getServerChannelReadLimit()
public long getDelayLimit()
public boolean checkPassword(String password)
password
- public abstract int getNextRangePort()
public String getBaseDirectory()
public void setIntProperty(String key, int i)
key
- i
- public void setServerPort(int port)
port
- the new portpublic void setServerAddress(String address)
address
- the address to use while answering for addresspublic void setBaseDirectory(String dir)
dir
- the new base directorypublic void setPassword(String password)
password
- the new password for shutdownpublic Class<? extends DataBusinessHandler> getDataBusinessHandler()
public void serverStartup() throws FtpNoConnectionException
FtpNoConnectionException
public void changeNetworkLimit(long writeLimit, long readLimit)
writeLimit
- readLimit
- public void computeNbThreads()
public Lock getLock()
public void bindLock()
public void bindUnlock()
public FtpInternalConfiguration getFtpInternalConfiguration()
public void setNewFtpSession(InetAddress ipOnly, InetSocketAddress fullIp, FtpSession session)
ipOnly
- fullIp
- session
- public FtpSession getFtpSession(io.netty.channel.Channel channel, boolean active)
channel
- active
- public FtpSession getFtpSessionNoRemove(io.netty.channel.Channel channel, boolean active)
channel
- active
- public void delFtpSession(InetAddress ipOnly, InetSocketAddress fullIp)
ipOnly
- fullIp
- public boolean hasFtpSession(InetAddress ipOnly, InetSocketAddress fullIp)
ipOnly
- fullIp
- public org.waarp.common.file.FileParameterInterface getFileParameter()
public String getUniqueExtension()
public void releaseResources()
public abstract void inShutdownProcess()
public boolean isShutdown()
public void setShutdown(boolean isShutdown)
isShutdown
- the isShutdown to setpublic int getSERVER_THREAD()
public void setSERVER_THREAD(int sERVER_THREAD)
sERVER_THREAD
- the sERVER_THREAD to setpublic int getCLIENT_THREAD()
public void setCLIENT_THREAD(int cLIENT_THREAD)
cLIENT_THREAD
- the cLIENT_THREAD to setpublic long getTIMEOUTCON()
public void setTIMEOUTCON(long tIMEOUTCON)
tIMEOUTCON
- the tIMEOUTCON to setpublic int getBLOCKSIZE()
public void setBLOCKSIZE(int bLOCKSIZE)
bLOCKSIZE
- the bLOCKSIZE to setpublic boolean isDeleteOnAbort()
public void setDeleteOnAbort(boolean deleteOnAbort)
deleteOnAbort
- the deleteOnAbort to setpublic static long getDATATIMEOUTCON()
public static void setDATATIMEOUTCON(long dATATIMEOUTCON)
dATATIMEOUTCON
- the dATATIMEOUTCON to setpublic long getMaxGlobalMemory()
public void setMaxGlobalMemory(long maxGlobalMemory)
maxGlobalMemory
- the maxGlobalMemory to setpublic org.waarp.common.utility.WaarpShutdownHook.ShutdownConfiguration getShutdownConfiguration()
Copyright © 2009–2019 Waarp. All rights reserved.