org.apache.ftpserver.usermanager.impl
Class BaseUser

java.lang.Object
  extended by org.apache.ftpserver.usermanager.impl.BaseUser
All Implemented Interfaces:
User

public class BaseUser
extends Object
implements User

Internal class, do not use directly. Generic user class. The user attributes are:

Author:
Apache MINA Project

Constructor Summary
BaseUser()
          Default constructor.
BaseUser(User user)
          Copy constructor.
 
Method Summary
 AuthorizationRequest authorize(AuthorizationRequest request)
          Authorize a AuthorizationRequest for this user
 List<Authority> getAuthorities()
          Get all authorities granted to this user
 List<Authority> getAuthorities(Class<? extends Authority> clazz)
          Get authorities of the specified type granted to this user
 boolean getEnabled()
          Get the user enable status.
 String getHomeDirectory()
          Get the user home directory.
 int getMaxIdleTime()
          Get the maximum idle time in second.
 String getName()
          Get the user name.
 String getPassword()
          Get the user password.
 void setAuthorities(List<Authority> authorities)
           
 void setEnabled(boolean enb)
          Set the user enable status.
 void setHomeDirectory(String home)
          Set the user home directory.
 void setMaxIdleTime(int idleSec)
          Set the maximum idle time in second.
 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseUser

public BaseUser()
Default constructor.


BaseUser

public BaseUser(User user)
Copy constructor.

Method Detail

getName

public String getName()
Get the user name.

Specified by:
getName in interface User
Returns:
The user name, the same used for login

setName

public void setName(String name)
Set user name.


getPassword

public String getPassword()
Get the user password.

Specified by:
getPassword in interface User
Returns:
The users password or null if the user manager can not provide the password

setPassword

public void setPassword(String pass)
Set user password.


getAuthorities

public List<Authority> getAuthorities()
Description copied from interface: User
Get all authorities granted to this user

Specified by:
getAuthorities in interface User
Returns:
All authorities

setAuthorities

public void setAuthorities(List<Authority> authorities)

getMaxIdleTime

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

Specified by:
getMaxIdleTime in interface User
Returns:
The idle time in seconds

setMaxIdleTime

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


getEnabled

public boolean getEnabled()
Get the user enable status.

Specified by:
getEnabled in interface User
Returns:
true if the user is enabled

setEnabled

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


getHomeDirectory

public String getHomeDirectory()
Get the user home directory.

Specified by:
getHomeDirectory in interface User
Returns:
The path to the home directory for the user

setHomeDirectory

public void setHomeDirectory(String home)
Set the user home directory.


toString

public String toString()
String representation.

Overrides:
toString in class Object

authorize

public AuthorizationRequest authorize(AuthorizationRequest request)
Authorize a AuthorizationRequest for this user

Specified by:
authorize in interface User
Parameters:
request - The AuthorizationRequest to authorize
Returns:
A populated AuthorizationRequest if the user was authorized, null otherwise.

getAuthorities

public List<Authority> getAuthorities(Class<? extends Authority> clazz)
Get authorities of the specified type granted to this user

Specified by:
getAuthorities in interface User
Parameters:
clazz - The type of Authority
Returns:
Authorities of the specified class


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