|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FtpSessionContext
This class servers as a means of transportation for data shared by a single FTP session.
Instances of the FtpSessionContextImpl
class are passed to each of the commands
while executing a FTP command sequence. The command objects read connection settings and other
options from the context. In turn data that may concern the general state of the FTP session can
be stored in the context.
Method Summary | |
---|---|
boolean |
authenticate()
|
void |
closeSockets()
Closes all sockets involved in current session. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns a sesson attribute. |
java.lang.String |
getCharset()
Returns the charset to be used for text output. |
java.io.BufferedReader |
getClientCmdReader()
Returns the Reader that is used to read client commands. |
java.io.PrintWriter |
getClientResponseWriter()
Returns the writer that is used to respond to client requests. |
java.net.Socket |
getClientSocket()
Returns the client communication socket. |
java.util.Date |
getCreationTime()
Date/time the session context was created. |
SocketProvider |
getDataSocketProvider()
Returns the object that provides the socket that is used for file transfer. |
int |
getDataType()
Returns the current data type (ASCII, BINARY, EPBCDIC). |
FtpEventListener |
getEventListener()
Returns the instance that listens to session events. |
int |
getMaxDownloadRate()
Returns the maximum transfer rate (download stream) in KB/s. |
int |
getMaxUploadRate()
Returns the maximum transfer rate (upload stream) in KB/s. |
java.lang.Integer |
getNextPassivePort()
Returns the next available port from a user defined list of passive ports. |
java.lang.String |
getOption(java.lang.String key)
Returns the value of an server option. |
FtpServerOptions |
getOptions()
|
java.lang.String |
getPassword()
Gets the user's password. |
int |
getPermission(java.lang.String path)
Gets the user's permission on the passed path. |
java.lang.String |
getRemoteDir()
Gets the current remote directory. |
java.lang.String |
getRemoteRelDir()
Gets the relative path, with respect to the FTP root path. |
java.lang.String |
getRes(java.lang.String id)
Returns a named resource from a resource bundle. |
java.util.Map<java.lang.String,java.lang.Long> |
getSessionStatistics()
Returns the session statistics. |
int |
getStorageStructure()
Returns the storage structure (File, Record). |
int |
getTransmissionMode()
Returns the transmission mode (Stream, Block, Compressed). |
java.lang.String |
getUser()
Returns the login name of the user. |
UserData |
getUserData()
Returns data about the current user. |
UserManager |
getUserManager()
Returns the user manager. |
boolean |
isAuthenticated()
Checks whether user was successfully authenticated. |
void |
resetCredentials()
Resets the user's credentials and unflags the authentication. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a session attribute. |
void |
setClientSocket(java.net.Socket clientSocket)
Sets the client communication socket. |
void |
setCreationTime(java.util.Date time)
Date/time the session context was created. |
void |
setDataSocketProvider(SocketProvider provider)
Sets the provider that provides the socket that is used in file transfer. |
void |
setDataType(int dataType)
Sets the current data type. |
void |
setPassword(java.lang.String password)
Sets the user's password. |
void |
setRemoteDir(java.lang.String remoteDir)
Sets the remote directory of the user's session. |
void |
setStorageStructure(int struct)
Sets the storage structure (File, Record). |
void |
setTransmissionMode(int mode)
Sets the transmission mode (Stream, Block, Compressed). |
void |
setUser(java.lang.String user)
Sets the login name of the user. |
void |
updateAverageStat(java.lang.String avgKey,
int value)
Updates the upload/download transfer rate taking the passed value into account. |
void |
updateIncrementalStat(java.lang.String countKey,
long value)
Updates incremental statistics such as number of files downloaded, bytes transferred etc. |
Method Detail |
---|
java.lang.Object getAttribute(java.lang.String name)
name
- Name of the attribute.
void setAttribute(java.lang.String name, java.lang.Object value)
name
- Name of the attribute.value
- Value of the attribute.FtpServerOptions getOptions()
java.lang.String getOption(java.lang.String key)
key
- The option name.
java.lang.String getPassword()
void setPassword(java.lang.String password)
password
- The users password.java.lang.String getRemoteDir()
java.lang.String getRemoteRelDir()
void setRemoteDir(java.lang.String remoteDir)
remoteDir
- The directory to set.java.lang.String getUser()
void setUser(java.lang.String user)
user
- The user name.FtpEventListener getEventListener()
java.lang.String getRes(java.lang.String id)
id
- The name of the resource.
boolean isAuthenticated()
int getDataType()
void setDataType(int dataType)
dataType
- The data type.int getTransmissionMode()
void setTransmissionMode(int mode)
mode
- The transmission mode.int getStorageStructure()
void setStorageStructure(int struct)
struct
- The storage structure..SocketProvider getDataSocketProvider()
void setDataSocketProvider(SocketProvider provider)
provider
- The socket provider.java.net.Socket getClientSocket()
void setClientSocket(java.net.Socket clientSocket) throws java.io.IOException
clientSocket
- The socket.
java.io.IOException
- Thrown if socket is invalid.java.io.PrintWriter getClientResponseWriter()
java.io.BufferedReader getClientCmdReader()
int getPermission(java.lang.String path)
path
- The path to check the permission on.
UserManager getUserManager()
java.lang.String getCharset()
java.lang.Integer getNextPassivePort()
boolean authenticate()
UserData getUserData()
void resetCredentials()
void closeSockets()
void setCreationTime(java.util.Date time)
time
- The creation time.java.util.Date getCreationTime()
java.util.Map<java.lang.String,java.lang.Long> getSessionStatistics()
void updateIncrementalStat(java.lang.String countKey, long value) throws FtpQuotaException
countKey
- Name of the statistics.value
- Value.
FtpQuotaException
- Thrown if a limit has been exceeded.void updateAverageStat(java.lang.String avgKey, int value)
avgKey
- The name of the statistic.value
- The valueint getMaxDownloadRate()
int getMaxUploadRate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |