org.openrdf.sesame.sailimpl.omm.security
Class UserImpl

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.omm.security.UserImpl
All Implemented Interfaces:
User

public class UserImpl
extends Object
implements User

UserImpl.java

Title: Knowledge Control System

Company: OntoText Lab. Sirma AI.

Version:
1.0 Implementation of the User Interface
Author:
borislav popov

Field Summary
static String ANONYMOUS
          a login and full name of the annonymous user
 
Constructor Summary
UserImpl(int id, String login, String password, String name)
          Construct a new user object.
 
Method Summary
 int getId()
          Retrieve the ID of the user
 String getLogin()
           
 String getName()
           
 String getPassword()
          Retrieve the user password
 Set getRoles()
          Retieve a set of the roles assigned to the user.
 Set getRules()
          Retrieve the security rules assigned to the user
 String getUri()
           
 UserInfo getUserInfo()
          Gets the user info.
 void setId(int id)
          Set the Id of the user
 void setLogin(String login)
           
 void setName(String name)
           
 void setPassword(String thePassword)
          Change the user password.
 void setRoles(Set roleIDs)
          Assign new Roles to the user.
 void setRules(Set rules)
          Assign new security rules to the user, as an alternative to assigning roles
 void setUri(String uri)
           
 void setUserInfo(UserInfo ui)
          Sets the user info.
 ArrayList toSql()
          Creates update queries over the user_rules users_roles tables.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANONYMOUS

public static final String ANONYMOUS
a login and full name of the annonymous user

See Also:
Constant Field Values
Constructor Detail

UserImpl

public UserImpl(int id,
                String login,
                String password,
                String name)
         throws NullParameterException
Construct a new user object.

Parameters:
id - the id of the user
login - the login of the user
password - user's password
name - the name of the user
Throws:
NullParameterException - Whenever some of the parameters are null
Method Detail

getId

public int getId()
Description copied from interface: User
Retrieve the ID of the user

Specified by:
getId in interface User
Returns:
userID

setId

public void setId(int id)
Description copied from interface: User
Set the Id of the user

Specified by:
setId in interface User
Parameters:
id - The user's id.

getLogin

public String getLogin()
Specified by:
getLogin in interface User

setLogin

public void setLogin(String login)
Specified by:
setLogin in interface User

getName

public String getName()
Specified by:
getName in interface User

setName

public void setName(String name)
Specified by:
setName in interface User

getPassword

public String getPassword()
Description copied from interface: User
Retrieve the user password

Specified by:
getPassword in interface User
Returns:
the password of the user

setPassword

public void setPassword(String thePassword)
                 throws NullParameterException
Description copied from interface: User
Change the user password.

Specified by:
setPassword in interface User
Parameters:
thePassword - new user password.
Throws:
NullParameterException - if the password is null.

getRoles

public Set getRoles()
Description copied from interface: User
Retieve a set of the roles assigned to the user.

Specified by:
getRoles in interface User

setRoles

public void setRoles(Set roleIDs)
              throws NullParameterException
Description copied from interface: User
Assign new Roles to the user. The previous role assignment is overidden.

Specified by:
setRoles in interface User
Parameters:
roleIDs - Set of roleIDs to be assigned to the user
Throws:
NullParameterException - if the set is null.

getRules

public Set getRules()
Description copied from interface: User
Retrieve the security rules assigned to the user

Specified by:
getRules in interface User
Returns:
Set of the rules assigned to the user

setRules

public void setRules(Set rules)
              throws NullParameterException
Description copied from interface: User
Assign new security rules to the user, as an alternative to assigning roles

Specified by:
setRules in interface User
Parameters:
rules - set of the rules to be set
Throws:
NullParameterException - if the set is null.

setUserInfo

public void setUserInfo(UserInfo ui)
                 throws NullParameterException
Description copied from interface: User
Sets the user info.

Specified by:
setUserInfo in interface User
Parameters:
ui - the user info to be set
Throws:
NullParameterException - if the parameter is null.

getUserInfo

public UserInfo getUserInfo()
Description copied from interface: User
Gets the user info.

Specified by:
getUserInfo in interface User
Returns:
the user info.

toSql

public ArrayList toSql()
Description copied from interface: User
Creates update queries over the user_rules users_roles tables.

Specified by:
toSql in interface User
Returns:
A list of update SQL queries, to be used to mirror the objects' properties from memory to an SQL repository.

setUri

public void setUri(String uri)
Specified by:
setUri in interface User

getUri

public String getUri()
Specified by:
getUri in interface User


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.