org.apache.ftpserver.usermanager
Class User

java.lang.Object
  extended byorg.apache.ftpserver.usermanager.User
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FtpUser

public class User
extends java.lang.Object
implements java.io.Serializable

Generic user class. All the application specific user classes will be derived from this.

Author:
Rana Bhattacharyya
See Also:
Serialized Form

Field Summary
static java.lang.String ATTR_ENABLE
          enableflag
static java.lang.String ATTR_HOME
          homedirectory
static java.lang.String ATTR_LOGIN
          uid
static java.lang.String ATTR_MAX_DOWNLOAD_RATE
          downloadrate
static java.lang.String ATTR_MAX_IDLE_TIME
          idletime
static java.lang.String ATTR_MAX_UPLOAD_RATE
          uploadrate
static java.lang.String ATTR_PASSWORD
          userpassword
static java.lang.String ATTR_WRITE_PERM
          writepermission
 
Constructor Summary
User()
          Constructor, set session id and default virtual directory object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Equality check.
 java.net.InetAddress getClientAddress()
          Get client address
 boolean getEnabled()
          Get the user enable status.
 long getLastAccessTime()
          Get last access time
 long getLoginTime()
          Get user loglin time.
 int getMaxDownloadRate()
          Get maximum user download rate in bytes/sec
 int getMaxIdleTime()
          Get the maximum idle time in second.
 int getMaxUploadRate()
          Get maximum user upload rate in bytes/sec.
 java.lang.String getName()
          Get the user name.
 java.lang.String getPassword()
          Get the user password.
 java.lang.String getSessionId()
          Get session id.
 VirtualDirectory getVirtualDirectory()
          get user filesystem view
 boolean hasLoggedIn()
          Check the user login status.
 void hitUser()
          Hit user - update last access time
 boolean isActive()
          Is still active.
 boolean isActive(long currTime)
          Is an active user (is removable)? Compares the last access time with the specified time.
 void login()
          User login.
 void logout()
          User logout
 void setClientAddress(java.net.InetAddress clientAddress)
          Set client address
 void setEnabled(boolean enb)
          Set the user enable status
 void setMaxDownloadRate(int rate)
          Set user maximum download rate limit.
 void setMaxIdleTime(int idleSec)
          Set the maximum idle time in second.
 void setMaxUploadRate(int rate)
          Set user maximum upload rate limit.
 void setName(java.lang.String name)
          Set user name.
 void setPassword(java.lang.String pass)
          Set user password
 java.lang.String toString()
          String representation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_LOGIN

public static final java.lang.String ATTR_LOGIN
uid

See Also:
Constant Field Values

ATTR_PASSWORD

public static final java.lang.String ATTR_PASSWORD
userpassword

See Also:
Constant Field Values

ATTR_HOME

public static final java.lang.String ATTR_HOME
homedirectory

See Also:
Constant Field Values

ATTR_WRITE_PERM

public static final java.lang.String ATTR_WRITE_PERM
writepermission

See Also:
Constant Field Values

ATTR_ENABLE

public static final java.lang.String ATTR_ENABLE
enableflag

See Also:
Constant Field Values

ATTR_MAX_IDLE_TIME

public static final java.lang.String ATTR_MAX_IDLE_TIME
idletime

See Also:
Constant Field Values

ATTR_MAX_UPLOAD_RATE

public static final java.lang.String ATTR_MAX_UPLOAD_RATE
uploadrate

See Also:
Constant Field Values

ATTR_MAX_DOWNLOAD_RATE

public static final java.lang.String ATTR_MAX_DOWNLOAD_RATE
downloadrate

See Also:
Constant Field Values
Constructor Detail

User

public User()
Constructor, set session id and default virtual directory object.

Method Detail

getName

public java.lang.String getName()
Get the user name.


setName

public void setName(java.lang.String name)
Set user name.


getPassword

public java.lang.String getPassword()
Get the user password.


setPassword

public void setPassword(java.lang.String pass)
Set user password


getMaxIdleTime

public int getMaxIdleTime()
Get the maximum idle time in second.


setMaxIdleTime

public void setMaxIdleTime(int idleSec)
Set the maximum idle time in second.


getEnabled

public boolean getEnabled()
Get the user enable status.


setEnabled

public void setEnabled(boolean enb)
Set the user enable status


getMaxUploadRate

public int getMaxUploadRate()
Get maximum user upload rate in bytes/sec.


setMaxUploadRate

public void setMaxUploadRate(int rate)
Set user maximum upload rate limit. Less than or equal to zero means no limit.


getMaxDownloadRate

public int getMaxDownloadRate()
Get maximum user download rate in bytes/sec


setMaxDownloadRate

public void setMaxDownloadRate(int rate)
Set user maximum download rate limit. Less than or equal to zero means no limit.


getClientAddress

public java.net.InetAddress getClientAddress()
Get client address


setClientAddress

public void setClientAddress(java.net.InetAddress clientAddress)
Set client address


getVirtualDirectory

public VirtualDirectory getVirtualDirectory()
get user filesystem view


getSessionId

public java.lang.String getSessionId()
Get session id.


getLoginTime

public long getLoginTime()
Get user loglin time.


getLastAccessTime

public long getLastAccessTime()
Get last access time


hasLoggedIn

public boolean hasLoggedIn()
Check the user login status.


login

public void login()
User login.


logout

public void logout()
User logout


isActive

public boolean isActive(long currTime)
Is an active user (is removable)? Compares the last access time with the specified time.


isActive

public boolean isActive()
Is still active. Compares the last access time with the current time.


hitUser

public void hitUser()
Hit user - update last access time


equals

public boolean equals(java.lang.Object obj)
Equality check.


toString

public java.lang.String toString()
String representation



Copyright © -2005 . All Rights Reserved.