public final class FCClientControlSocket
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FCClientControlSocket.FCSiteDO |
| Modifier and Type | Field and Description |
|---|---|
static java.util.function.Supplier<java.lang.Boolean> |
USE_STICKY_SESSIONS |
| Constructor and Description |
|---|
FCClientControlSocket(java.net.Socket controlSocket,
boolean sslSocket,
LogUtils fileLog,
int timeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLostReply(FCReply lostReply) |
void |
addLostReply(java.lang.String reply) |
FCSiteIfc |
checkIfConnectedToLoadBalancer() |
void |
close() |
void |
connectToHost(java.lang.String remoteHost,
int controlPort) |
void |
connectToServer(java.lang.String remoteHost,
int controlPort) |
java.net.Socket |
createDataSocket() |
java.net.Socket |
createDataSocket(boolean nio) |
java.net.Socket |
createDataSocketActive() |
java.net.Socket |
createDataSocketActiveSendCommand(java.lang.String command) |
java.net.Socket |
createDataSocketPassive() |
java.net.Socket |
createDataSocketPassive(boolean nio)
Request a data socket be created on the server, connect to it and return
our connected socket.
|
java.net.Socket[] |
createDataSocketPassive(int num) |
java.net.Socket[] |
createDataSocketPassive(int num,
boolean nio)
Request several data sockets be created on the server, connect and return
our connected sockets.
|
java.net.Socket[] |
createDataSockets(int num) |
javax.net.ssl.SSLSocket |
createSSLSocket(java.lang.String host,
int port) |
javax.net.ssl.SSLSocket |
createSSLSocket(java.lang.String host,
int port,
boolean needHandshake) |
void |
debugResponses(boolean on)
Switch debug of responses on or off
|
java.net.InetAddress |
getAddress() |
int |
getAvgRTT() |
int |
getControlPort() |
static FCClientControlSocket |
getControlSocket(FCClientControlSocketRequestData requestData) |
int |
getCurrentRTT() |
java.lang.String |
getHost() |
java.lang.String |
getLocalHost()
Get the name of the remote host
|
LogUtils |
getLog() |
FCReply |
getLostReplies(java.lang.String... replyCodes) |
FCReply |
getLostReply(java.lang.String replyCode) |
int |
getLowRTT() |
int |
getPort() |
java.lang.String |
getRemoteHostName()
Get the name of the remote host
|
int |
getRemotePort() |
FCSiteIfc |
getResolvedSiteDO() |
java.lang.String |
getSysKey() |
java.lang.String |
getWelcomeMessage() |
boolean |
isIPv6() |
boolean |
isSsl() |
boolean |
isSSL() |
long |
lastActivity() |
void |
logout()
Quit this FileCatalyst session and clean up.
|
java.util.List<java.lang.String> |
parseHosts(java.lang.String remoteHost) |
static int |
parsePort(int parseFirst,
int parseSecond) |
java.lang.String |
readReply() |
java.lang.String |
readReply(boolean log)
Read the FileCatalyst server's reply to a previously issued command.
|
void |
reconnect() |
void |
registerLookUp(FCSiteIfc lookup) |
java.lang.String |
sendCommand(java.lang.String command)
Send a command to the FileCatalyst server and return the server's reply
|
java.lang.String |
sendCommand(java.lang.StringBuffer command)
Send a command to the FileCatalyst server and return the server's reply
|
void |
sendCommandNoReply(java.lang.String command)
Send a command to the FileCatalyst server and return the server's reply
|
void |
setConnectTimeout() |
void |
setIPTOSIfRequired() |
void |
setLogStream(LogUtils fileLog)
Set the logging stream, replacing stdout
|
void |
setTimeout(int millis)
Set the TCP timeout on the underlying control socket.
|
void |
setWelcomeMessage(java.lang.String welcomeMessage) |
public static final java.util.function.Supplier<java.lang.Boolean> USE_STICKY_SESSIONS
public FCClientControlSocket(java.net.Socket controlSocket,
boolean sslSocket,
LogUtils fileLog,
int timeout)
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic static FCClientControlSocket getControlSocket(FCClientControlSocketRequestData requestData) throws java.io.IOException, FCException
java.io.IOExceptionFCExceptionpublic void connectToHost(java.lang.String remoteHost,
int controlPort)
throws java.io.IOException
java.io.IOExceptionpublic java.util.List<java.lang.String> parseHosts(java.lang.String remoteHost)
public FCSiteIfc checkIfConnectedToLoadBalancer()
throws java.io.IOException
java.io.IOExceptionpublic void connectToServer(java.lang.String remoteHost,
int controlPort)
throws java.io.IOException,
java.net.SocketException
java.io.IOExceptionjava.net.SocketExceptionpublic javax.net.ssl.SSLSocket createSSLSocket(java.lang.String host,
int port)
throws java.io.IOException
java.io.IOExceptionpublic javax.net.ssl.SSLSocket createSSLSocket(java.lang.String host,
int port,
boolean needHandshake)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getRemoteHostName()
public boolean isSSL()
public LogUtils getLog()
public java.net.InetAddress getAddress()
public int getRemotePort()
public boolean isIPv6()
public void reconnect()
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic java.lang.String getLocalHost()
public void setTimeout(int millis)
throws java.net.SocketException
millis - The length of the timeout, in millisecondsjava.io.IOException - if the timeout can not be setjava.net.SocketExceptionpublic void setConnectTimeout()
throws java.net.SocketException
java.net.SocketExceptionpublic void close()
throws java.lang.Exception
java.lang.Exceptionpublic void logout()
throws java.io.IOException
java.io.IOException - if an IOException is caughtpublic void sendCommandNoReply(java.lang.String command)
throws java.io.IOException
command - the command to be send to FTP serverjava.io.IOException - if the send is failingpublic java.lang.String sendCommand(java.lang.String command)
throws java.io.IOException
command - the command to be send to FTP serverjava.io.IOException - if the send is failingpublic long lastActivity()
public java.lang.String sendCommand(java.lang.StringBuffer command)
throws java.io.IOException
command - the command to be send to FTP serverjava.io.IOException - if the send is failingpublic int getAvgRTT()
public int getLowRTT()
public int getCurrentRTT()
public java.lang.String readReply()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readReply(boolean log)
throws java.io.IOException
java.io.IOException - if an IOException is caught.public void debugResponses(boolean on)
on - true if you wish to have responses to stdout, false otherwisepublic void setLogStream(LogUtils fileLog)
logFile - the new logging streampublic java.net.Socket[] createDataSocketPassive(int num)
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic java.net.Socket[] createDataSocketPassive(int num,
boolean nio)
throws java.io.IOException,
FCException
java.io.IOException - if an IOException is caught.FtpException - if the server socket can not be createdFCExceptionpublic static int parsePort(int parseFirst,
int parseSecond)
public java.net.Socket createDataSocketPassive()
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic java.net.Socket createDataSocketPassive(boolean nio)
throws java.io.IOException,
FCException
java.io.IOException - if an IOException is caught.FtpException - if the server socket can not be createdFCExceptionpublic java.net.Socket createDataSocketActive()
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic java.net.Socket createDataSocketActiveSendCommand(java.lang.String command)
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic java.net.Socket createDataSocket()
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic java.net.Socket createDataSocket(boolean nio)
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic java.net.Socket[] createDataSockets(int num)
throws java.io.IOException,
FCException
java.io.IOExceptionFCExceptionpublic void setWelcomeMessage(java.lang.String welcomeMessage)
public java.lang.String getWelcomeMessage()
public final void addLostReply(java.lang.String reply)
public final void addLostReply(FCReply lostReply)
public final FCReply getLostReplies(java.lang.String... replyCodes)
public final FCReply getLostReply(java.lang.String replyCode)
public void setIPTOSIfRequired()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getSysKey()
public int getControlPort()
public boolean isSsl()
public java.lang.String getHost()
public int getPort()
public FCSiteIfc getResolvedSiteDO()
public void registerLookUp(FCSiteIfc lookup)