org.apache.ftpserver.usermanager
Class User

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

public class User
extends Object
implements 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 String ATTR_ENABLE
          enableflag
static String ATTR_HOME
          homedirectory
static String ATTR_LOGIN
          uid
static String ATTR_MAX_DOWNLOAD_RATE
          downloadrate
static String ATTR_MAX_IDLE_TIME
          idletime
static String ATTR_MAX_UPLOAD_RATE
          uploadrate
static String ATTR_PASSWORD
          userpassword
static String ATTR_WRITE_PERM
          writepermission
 
Constructor Summary
User()
          Constructor, set session id and default virtual directory object.
 
Method Summary
 boolean equals(Object obj)
          Equality check.
 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.
 String getName()
          Get the user name.
 String getPassword()
          Get the user password.
 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(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(String name)
          Set user name.
 void setPassword(String pass)
          Set user password
 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 String ATTR_LOGIN
uid

See Also:
Constant Field Values

ATTR_PASSWORD

public static final String ATTR_PASSWORD
userpassword

See Also:
Constant Field Values

ATTR_HOME

public static final String ATTR_HOME
homedirectory

See Also:
Constant Field Values

ATTR_WRITE_PERM

public static final String ATTR_WRITE_PERM
writepermission

See Also:
Constant Field Values

ATTR_ENABLE

public static final String ATTR_ENABLE
enableflag

See Also:
Constant Field Values

ATTR_MAX_IDLE_TIME

public static final String ATTR_MAX_IDLE_TIME
idletime

See Also:
Constant Field Values

ATTR_MAX_UPLOAD_RATE

public static final String ATTR_MAX_UPLOAD_RATE
uploadrate

See Also:
Constant Field Values

ATTR_MAX_DOWNLOAD_RATE

public static final 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 String getName()
Get the user name.


setName

public void setName(String name)
Set user name.


getPassword

public String getPassword()
Get the user password.


setPassword

public void setPassword(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 InetAddress getClientAddress()
Get client address


setClientAddress

public void setClientAddress(InetAddress clientAddress)
Set client address


getVirtualDirectory

public VirtualDirectory getVirtualDirectory()
get user filesystem view


getSessionId

public 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(Object obj)
Equality check.

Overrides:
equals in class Object

toString

public String toString()
String representation

Overrides:
toString in class Object


Copyright © 2001-2012 Codehaus. All Rights Reserved.