org.apache.ftpserver.impl
Class FtpIoSession

java.lang.Object
  extended by org.apache.ftpserver.impl.FtpIoSession
All Implemented Interfaces:
org.apache.mina.core.session.IoSession

public class FtpIoSession
extends java.lang.Object
implements org.apache.mina.core.session.IoSession

Internal class, do not use directly.

Version:
$Rev$, $Date$
Author:
The Apache MINA Project (dev@mina.apache.org)

Field Summary
static java.lang.String ATTRIBUTE_PREFIX
          Contains user name between USER and PASS commands
 
Constructor Summary
FtpIoSession(org.apache.mina.core.session.IoSession wrappedSession, FtpServerContext context)
           
 
Method Summary
 org.apache.mina.core.future.CloseFuture close()
           
 org.apache.mina.core.future.CloseFuture close(boolean immediately)
           
 boolean containsAttribute(java.lang.Object key)
           
 java.lang.Object getAttachment()
           
 java.lang.Object getAttribute(java.lang.Object key)
           
 java.lang.Object getAttribute(java.lang.Object key, java.lang.Object defaultValue)
           
 java.util.Set<java.lang.Object> getAttributeKeys()
           
 int getBothIdleCount()
           
 java.security.cert.Certificate[] getClientCertificates()
           
 org.apache.mina.core.future.CloseFuture getCloseFuture()
           
 org.apache.mina.core.session.IoSessionConfig getConfig()
           
 long getCreationTime()
           
 java.lang.Object getCurrentWriteMessage()
           
 org.apache.mina.core.write.WriteRequest getCurrentWriteRequest()
           
 ServerDataConnectionFactory getDataConnection()
           
 DataType getDataType()
           
 int getFailedLogins()
           
 long getFileOffset()
           
 FileSystemView getFileSystemView()
           
 org.apache.mina.core.filterchain.IoFilterChain getFilterChain()
           
 FtpSession getFtpletSession()
           
 org.apache.mina.core.service.IoHandler getHandler()
           
 long getId()
           
 int getIdleCount(org.apache.mina.core.session.IdleStatus status)
           
 java.lang.String getLanguage()
           
 java.util.Date getLastAccessTime()
           
 long getLastBothIdleTime()
           
 long getLastIdleTime(org.apache.mina.core.session.IdleStatus status)
           
 long getLastIoTime()
           
 long getLastReaderIdleTime()
           
 long getLastReadTime()
           
 FtpReply getLastReply()
          Returns the last reply that was sent to the client.
 long getLastWriterIdleTime()
           
 long getLastWriteTime()
           
 Listener getListener()
           
 java.net.SocketAddress getLocalAddress()
           
 java.util.Date getLoginTime()
           
 int getMaxIdleTime()
           
 long getReadBytes()
           
 double getReadBytesThroughput()
           
 int getReaderIdleCount()
           
 long getReadMessages()
           
 double getReadMessagesThroughput()
           
 java.net.SocketAddress getRemoteAddress()
           
 FtpFile getRenameFrom()
           
 long getScheduledWriteBytes()
           
 int getScheduledWriteMessages()
           
 org.apache.mina.core.service.IoService getService()
           
 java.net.SocketAddress getServiceAddress()
           
 java.util.UUID getSessionId()
           
 Structure getStructure()
           
 org.apache.mina.core.service.TransportMetadata getTransportMetadata()
           
 User getUser()
           
 java.lang.String getUserArgument()
           
 org.apache.mina.core.write.WriteRequestQueue getWriteRequestQueue()
           
 int getWriterIdleCount()
           
 long getWrittenBytes()
           
 double getWrittenBytesThroughput()
           
 long getWrittenMessages()
           
 double getWrittenMessagesThroughput()
           
 void increaseFailedLogins()
           
 void increaseReadDataBytes(int increment)
          Increase the number of bytes read on the data connection
 void increaseWrittenDataBytes(int increment)
          Increase the number of bytes written on the data connection
 boolean isBothIdle()
           
 boolean isClosing()
           
 boolean isConnected()
           
 boolean isIdle(org.apache.mina.core.session.IdleStatus status)
           
 boolean isLoggedIn()
          Is logged-in
 boolean isReaderIdle()
           
 boolean isReadSuspended()
           
 boolean isSecure()
          Indicates whether the control socket for this session is secure, that is, running over SSL/TLS
 boolean isWriterIdle()
           
 boolean isWriteSuspended()
           
 org.apache.mina.core.future.ReadFuture read()
           
 void reinitialize()
           
 java.lang.Object removeAttribute(java.lang.Object key)
           
 boolean removeAttribute(java.lang.Object key, java.lang.Object value)
           
 boolean replaceAttribute(java.lang.Object key, java.lang.Object oldValue, java.lang.Object newValue)
           
 void resetState()
           
 void resumeRead()
           
 void resumeWrite()
           
 java.lang.Object setAttachment(java.lang.Object attachment)
           
 java.lang.Object setAttribute(java.lang.Object key)
           
 java.lang.Object setAttribute(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object setAttributeIfAbsent(java.lang.Object key)
           
 java.lang.Object setAttributeIfAbsent(java.lang.Object key, java.lang.Object value)
           
 void setCurrentWriteRequest(org.apache.mina.core.write.WriteRequest currentWriteRequest)
           
 void setDataType(DataType dataType)
           
 void setFileOffset(long fileOffset)
           
 void setLanguage(java.lang.String language)
           
 void setListener(Listener listener)
           
 void setLogin(FileSystemView fsview)
           
 void setMaxIdleTime(int maxIdleTime)
           
 void setRenameFrom(FtpFile renFr)
           
 void setStructure(Structure structure)
           
 void setUser(User user)
           
 void setUserArgument(java.lang.String userArgument)
           
 void suspendRead()
           
 void suspendWrite()
           
 void updateLastAccessTime()
           
 void updateThroughput(long currentTime, boolean force)
           
 org.apache.mina.core.future.WriteFuture write(java.lang.Object message)
           
 org.apache.mina.core.future.WriteFuture write(java.lang.Object message, java.net.SocketAddress destination)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_PREFIX

public static final java.lang.String ATTRIBUTE_PREFIX
Contains user name between USER and PASS commands

See Also:
Constant Field Values
Constructor Detail

FtpIoSession

public FtpIoSession(org.apache.mina.core.session.IoSession wrappedSession,
                    FtpServerContext context)
Method Detail

close

public org.apache.mina.core.future.CloseFuture close()
Specified by:
close in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.close()

close

public org.apache.mina.core.future.CloseFuture close(boolean immediately)
Specified by:
close in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.close(boolean)

containsAttribute

public boolean containsAttribute(java.lang.Object key)
Specified by:
containsAttribute in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.containsAttribute(Object)

getAttachment

public java.lang.Object getAttachment()
Specified by:
getAttachment in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getAttachment()

getAttribute

public java.lang.Object getAttribute(java.lang.Object key)
Specified by:
getAttribute in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getAttribute(Object)

getAttribute

public java.lang.Object getAttribute(java.lang.Object key,
                                     java.lang.Object defaultValue)
Specified by:
getAttribute in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getAttribute(Object, Object)

getAttributeKeys

public java.util.Set<java.lang.Object> getAttributeKeys()
Specified by:
getAttributeKeys in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getAttributeKeys()

getBothIdleCount

public int getBothIdleCount()
Specified by:
getBothIdleCount in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getBothIdleCount()

getCloseFuture

public org.apache.mina.core.future.CloseFuture getCloseFuture()
Specified by:
getCloseFuture in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getCloseFuture()

getConfig

public org.apache.mina.core.session.IoSessionConfig getConfig()
Specified by:
getConfig in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getConfig()

getCreationTime

public long getCreationTime()
Specified by:
getCreationTime in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getCreationTime()

getFilterChain

public org.apache.mina.core.filterchain.IoFilterChain getFilterChain()
Specified by:
getFilterChain in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getFilterChain()

getHandler

public org.apache.mina.core.service.IoHandler getHandler()
Specified by:
getHandler in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getHandler()

getId

public long getId()
Specified by:
getId in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getId()

getIdleCount

public int getIdleCount(org.apache.mina.core.session.IdleStatus status)
Specified by:
getIdleCount in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getIdleCount(IdleStatus)

getLastBothIdleTime

public long getLastBothIdleTime()
Specified by:
getLastBothIdleTime in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getLastBothIdleTime()

getLastIdleTime

public long getLastIdleTime(org.apache.mina.core.session.IdleStatus status)
Specified by:
getLastIdleTime in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getLastIdleTime(IdleStatus)

getLastIoTime

public long getLastIoTime()
Specified by:
getLastIoTime in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getLastIoTime()

getLastReadTime

public long getLastReadTime()
Specified by:
getLastReadTime in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getLastReadTime()

getLastReaderIdleTime

public long getLastReaderIdleTime()
Specified by:
getLastReaderIdleTime in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getLastReaderIdleTime()

getLastWriteTime

public long getLastWriteTime()
Specified by:
getLastWriteTime in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getLastWriteTime()

getLastWriterIdleTime

public long getLastWriterIdleTime()
Specified by:
getLastWriterIdleTime in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getLastWriterIdleTime()

getLocalAddress

public java.net.SocketAddress getLocalAddress()
Specified by:
getLocalAddress in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getLocalAddress()

getReadBytes

public long getReadBytes()
Specified by:
getReadBytes in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getReadBytes()

getReadBytesThroughput

public double getReadBytesThroughput()
Specified by:
getReadBytesThroughput in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getReadBytesThroughput()

getReadMessages

public long getReadMessages()
Specified by:
getReadMessages in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getReadMessages()

getReadMessagesThroughput

public double getReadMessagesThroughput()
Specified by:
getReadMessagesThroughput in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getReadMessagesThroughput()

getReaderIdleCount

public int getReaderIdleCount()
Specified by:
getReaderIdleCount in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getReaderIdleCount()

getRemoteAddress

public java.net.SocketAddress getRemoteAddress()
Specified by:
getRemoteAddress in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getRemoteAddress()

getScheduledWriteBytes

public long getScheduledWriteBytes()
Specified by:
getScheduledWriteBytes in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getScheduledWriteBytes()

getScheduledWriteMessages

public int getScheduledWriteMessages()
Specified by:
getScheduledWriteMessages in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getScheduledWriteMessages()

getService

public org.apache.mina.core.service.IoService getService()
Specified by:
getService in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getService()

getServiceAddress

public java.net.SocketAddress getServiceAddress()
Specified by:
getServiceAddress in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getServiceAddress()

getTransportMetadata

public org.apache.mina.core.service.TransportMetadata getTransportMetadata()
Specified by:
getTransportMetadata in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getTransportMetadata()

getWriterIdleCount

public int getWriterIdleCount()
Specified by:
getWriterIdleCount in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getWriterIdleCount()

getWrittenBytes

public long getWrittenBytes()
Specified by:
getWrittenBytes in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getWrittenBytes()

getWrittenBytesThroughput

public double getWrittenBytesThroughput()
Specified by:
getWrittenBytesThroughput in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getWrittenBytesThroughput()

getWrittenMessages

public long getWrittenMessages()
Specified by:
getWrittenMessages in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getWrittenMessages()

getWrittenMessagesThroughput

public double getWrittenMessagesThroughput()
Specified by:
getWrittenMessagesThroughput in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getWrittenMessagesThroughput()

isClosing

public boolean isClosing()
Specified by:
isClosing in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.isClosing()

isConnected

public boolean isConnected()
Specified by:
isConnected in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.isConnected()

isIdle

public boolean isIdle(org.apache.mina.core.session.IdleStatus status)
Specified by:
isIdle in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.isIdle(IdleStatus)

read

public org.apache.mina.core.future.ReadFuture read()
Specified by:
read in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.read()

removeAttribute

public java.lang.Object removeAttribute(java.lang.Object key)
Specified by:
removeAttribute in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.removeAttribute(Object)

removeAttribute

public boolean removeAttribute(java.lang.Object key,
                               java.lang.Object value)
Specified by:
removeAttribute in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.removeAttribute(Object, Object)

replaceAttribute

public boolean replaceAttribute(java.lang.Object key,
                                java.lang.Object oldValue,
                                java.lang.Object newValue)
Specified by:
replaceAttribute in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.replaceAttribute(Object, Object, Object)

resumeRead

public void resumeRead()
Specified by:
resumeRead in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.resumeRead()

resumeWrite

public void resumeWrite()
Specified by:
resumeWrite in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.resumeWrite()

setAttachment

public java.lang.Object setAttachment(java.lang.Object attachment)
Specified by:
setAttachment in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.setAttachment(Object)

setAttribute

public java.lang.Object setAttribute(java.lang.Object key)
Specified by:
setAttribute in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.setAttribute(Object)

setAttribute

public java.lang.Object setAttribute(java.lang.Object key,
                                     java.lang.Object value)
Specified by:
setAttribute in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.setAttribute(Object, Object)

setAttributeIfAbsent

public java.lang.Object setAttributeIfAbsent(java.lang.Object key)
Specified by:
setAttributeIfAbsent in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.setAttributeIfAbsent(Object)

setAttributeIfAbsent

public java.lang.Object setAttributeIfAbsent(java.lang.Object key,
                                             java.lang.Object value)
Specified by:
setAttributeIfAbsent in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.setAttributeIfAbsent(Object, Object)

suspendRead

public void suspendRead()
Specified by:
suspendRead in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.suspendRead()

suspendWrite

public void suspendWrite()
Specified by:
suspendWrite in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.suspendWrite()

write

public org.apache.mina.core.future.WriteFuture write(java.lang.Object message)
Specified by:
write in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.write(Object)

write

public org.apache.mina.core.future.WriteFuture write(java.lang.Object message,
                                                     java.net.SocketAddress destination)
Specified by:
write in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.write(Object, SocketAddress)

resetState

public void resetState()

getDataConnection

public ServerDataConnectionFactory getDataConnection()

getFileSystemView

public FileSystemView getFileSystemView()

getUser

public User getUser()

isLoggedIn

public boolean isLoggedIn()
Is logged-in


getListener

public Listener getListener()

setListener

public void setListener(Listener listener)

getFtpletSession

public FtpSession getFtpletSession()

getLanguage

public java.lang.String getLanguage()

setLanguage

public void setLanguage(java.lang.String language)

getUserArgument

public java.lang.String getUserArgument()

setUser

public void setUser(User user)

setUserArgument

public void setUserArgument(java.lang.String userArgument)

getMaxIdleTime

public int getMaxIdleTime()

setMaxIdleTime

public void setMaxIdleTime(int maxIdleTime)

increaseFailedLogins

public void increaseFailedLogins()

getFailedLogins

public int getFailedLogins()

setLogin

public void setLogin(FileSystemView fsview)

reinitialize

public void reinitialize()

setFileOffset

public void setFileOffset(long fileOffset)

setRenameFrom

public void setRenameFrom(FtpFile renFr)

getRenameFrom

public FtpFile getRenameFrom()

getFileOffset

public long getFileOffset()

setStructure

public void setStructure(Structure structure)

setDataType

public void setDataType(DataType dataType)

getSessionId

public java.util.UUID getSessionId()
See Also:
FtpSession.getSessionId()

getStructure

public Structure getStructure()

getDataType

public DataType getDataType()

getLoginTime

public java.util.Date getLoginTime()

getLastAccessTime

public java.util.Date getLastAccessTime()

getClientCertificates

public java.security.cert.Certificate[] getClientCertificates()

updateLastAccessTime

public void updateLastAccessTime()

getCurrentWriteMessage

public java.lang.Object getCurrentWriteMessage()
Specified by:
getCurrentWriteMessage in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getCurrentWriteMessage()

getCurrentWriteRequest

public org.apache.mina.core.write.WriteRequest getCurrentWriteRequest()
Specified by:
getCurrentWriteRequest in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getCurrentWriteRequest()

isBothIdle

public boolean isBothIdle()
Specified by:
isBothIdle in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.isBothIdle()

isReaderIdle

public boolean isReaderIdle()
Specified by:
isReaderIdle in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.isReaderIdle()

isWriterIdle

public boolean isWriterIdle()
Specified by:
isWriterIdle in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.isWriterIdle()

isSecure

public boolean isSecure()
Indicates whether the control socket for this session is secure, that is, running over SSL/TLS

Returns:
true if the control socket is secured

increaseWrittenDataBytes

public void increaseWrittenDataBytes(int increment)
Increase the number of bytes written on the data connection

Parameters:
increment - The number of bytes written

increaseReadDataBytes

public void increaseReadDataBytes(int increment)
Increase the number of bytes read on the data connection

Parameters:
increment - The number of bytes written

getLastReply

public FtpReply getLastReply()
Returns the last reply that was sent to the client.

Returns:
the last reply that was sent to the client.

getWriteRequestQueue

public org.apache.mina.core.write.WriteRequestQueue getWriteRequestQueue()
Specified by:
getWriteRequestQueue in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.getWriteRequestQueue()

isReadSuspended

public boolean isReadSuspended()
Specified by:
isReadSuspended in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.isReadSuspended()

isWriteSuspended

public boolean isWriteSuspended()
Specified by:
isWriteSuspended in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.isWriteSuspended()

setCurrentWriteRequest

public void setCurrentWriteRequest(org.apache.mina.core.write.WriteRequest currentWriteRequest)
Specified by:
setCurrentWriteRequest in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.setCurrentWriteRequest(WriteRequest)

updateThroughput

public void updateThroughput(long currentTime,
                             boolean force)
Specified by:
updateThroughput in interface org.apache.mina.core.session.IoSession
See Also:
IoSession.updateThroughput(long, boolean)


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.