|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.uka.ipd.consensus.impl.TM4JObjectWrapper de.uka.ipd.consensus.impl.UserImpl
TODO
Field Summary |
Fields inherited from class de.uka.ipd.consensus.impl.TM4JObjectWrapper |
EMPTY_SCOPE |
Method Summary | |
Rating |
addRating(User rater,
double value)
Adds a rating for the given user to this element. |
void |
addRole(UserRole role)
Adds a UserRole to this user's roles. |
protected void |
change(int passwordHash,
String firstname,
String lastname,
String email,
String comment)
|
int |
compareTo(Object obj)
|
protected static String |
extractUsername(String userid)
|
double |
getAverageOwnRatingsValue()
Returns the average value (the arithmetic mean) of all ratings that this user has given to other elements of the ontology. |
double |
getAverageRatingValue()
Returns the average value (the arithmetic mean) of all current ratings for this element. |
String |
getComment()
Returns the comment of the element. |
String |
getEmail()
|
String |
getFirstname()
|
String |
getId()
Returns the user's id that was computed automatically from the username when the user created his account. |
static UserImpl |
getInstance(OntologyManagerImpl omi,
org.tm4j.topicmap.Topic userTopic)
|
static UserImpl |
getInstance(UserManagerImpl umi,
String username,
int passwordHash,
String firstname,
String lastname,
String email,
double initScore,
String comment,
String roles)
|
String |
getLastname()
|
Date |
getLoginTime()
|
Collection |
getOwnRatings()
Returns a collection of all current Rating objects that this user has given to other elements of the ontology. |
int |
getOwnRatingsCount()
Returns the number of ratings that this user has given to other elements of the ontology. |
int |
getPasswordHash()
|
Rating |
getRating(User user)
Returns the rating of the given user for this element. |
Collection |
getRatings()
Returns a collection of all current Rating objects (from different users) for this element. |
int |
getRatingsCount()
Returns the number of ratings for this element. |
Collection |
getRoles()
Returns a collection of UserRole objects that this user is in. |
double |
getScore()
Returns this user's score. |
UserManager |
getUserManager()
Returns the UserManager instance that manages this user account. |
String |
getUsername()
Returns the username that the user has given himself when creating his user account. |
protected org.tm4j.topicmap.Topic |
getWrappedTopic()
|
protected void |
init(int passwordHash,
String firstname,
String lastname,
String email,
double initScore,
String comment,
String roles)
|
boolean |
isAdmin()
Checks if the user is in the admin role. |
boolean |
isInRole(UserRole role)
Checks if the user is in the given role. |
boolean |
isLoggedOn()
Checks if the user is logged on. |
boolean |
isSuperAdmin()
|
void |
removeRole(UserRole role)
Removes a UserRole from this user's roles. |
void |
setComment(User setter,
String comment)
Changes the element's comment. |
protected void |
setLoggedOn(boolean loggedOn)
|
void |
setScore(double score)
Changes this user's score. |
String |
toString()
|
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent event)
|
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
|
Methods inherited from class de.uka.ipd.consensus.impl.TM4JObjectWrapper |
equals, getCache, getLoggingManager, getObjectId, getOccurrence, getOntologyManager, getWrappedObject, hashCode, putCache, wrap, wrap, wrap, wrap, wrap, wrap, wrap |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public static UserImpl getInstance(OntologyManagerImpl omi, org.tm4j.topicmap.Topic userTopic)
public static UserImpl getInstance(UserManagerImpl umi, String username, int passwordHash, String firstname, String lastname, String email, double initScore, String comment, String roles) throws Exception
Exception
protected void init(int passwordHash, String firstname, String lastname, String email, double initScore, String comment, String roles)
protected void change(int passwordHash, String firstname, String lastname, String email, String comment)
protected org.tm4j.topicmap.Topic getWrappedTopic()
public UserManager getUserManager()
User
getUserManager
in interface User
null
public String getUsername()
User
getUsername
in interface User
null
)User.getId()
,
UserManager.createUser(String, String, Map)
,
UserManager.getUserByUsername(String)
protected static String extractUsername(String userid)
public String getId()
User
getId
in interface User
null
)User.getUsername()
,
UserManager.createUser(String, String, Map)
,
UserManager.getUserById(String)
public String getFirstname()
public String getLastname()
public String getEmail()
public int getPasswordHash()
public Date getLoginTime()
public Collection getRatings()
Rateable
getRatings()
methods of RatingManager
.
getRatings
in interface Rateable
null
Rating
,
RatingManager
public double getAverageRatingValue()
Rateable
getAverageRatingValue
in interface Rateable
public int getRatingsCount()
Rateable
getRatingsCount
in interface Rateable
public Rating addRating(User rater, double value) throws RatingManagerException, DynamicRightsManagerException
Rateable
RatingManager
methods.
addRating
in interface Rateable
rater
- the user who wants to add or change the ratingvalue
- the new value
DynamicRightsManagerException
- if the user is not allowed to rate this element
RatingManagerException
- if the rating could not be created/changedRatingManager
,
DynamicRightsManager.mayAddRating(Rating, Rateable)
public Rating getRating(User user)
Rateable
getRatings()
methods of RatingManager
.
getRating
in interface Rateable
user
- the user who's rating shall be returned
null
if the user hasn't rated this element yetRatingManager
public double getAverageOwnRatingsValue()
User
getAverageOwnRatingsValue
in interface User
public Collection getOwnRatings()
User
RatingManager
method.
getOwnRatings
in interface User
null
Rating
,
RatingManager.getUsersOwnRatings(User)
public int getOwnRatingsCount()
User
getOwnRatingsCount
in interface User
public String getComment()
Commentatable
getComment
in interface Commentatable
null
)public void setComment(User setter, String comment) throws OntologyManagerException, DynamicRightsManagerException
Commentatable
setComment
in interface Commentatable
setter
- the user who wants to change the commentcomment
- the new comment (null
is treated as an empty string)
DynamicRightsManagerException
- if the user is not allowed to change the comment
OntologyManagerException
- if the comment could not be changedDynamicRightsManager.mayChangeConceptComment(User, Concept)
,
DynamicRightsManager.mayChangeUserComment(User, User)
public String toString()
public int compareTo(Object obj)
compareTo
in interface Comparable
public void setScore(double score)
User
setScore
in interface User
score
- the new score (an absolute value, not a delta value!)User.getScore()
,
ScoringListener
public double getScore()
User
getScore
in interface User
User.setScore(double)
,
IncentiveManager.getInitialUserScore()
,
ScoringListener
public void addRole(UserRole role)
User
addRole
in interface User
role
- the UserRole to addUserManager.findRole(String)
public Collection getRoles()
User
getRoles
in interface User
null
UserRole
public boolean isInRole(UserRole role)
User
isInRole
in interface User
role
- the role to check
true
if the user is in the role, false
otherwiseUserManager.findRole(String)
public void removeRole(UserRole role)
User
removeRole
in interface User
role
- the UserRole to removeUserManager.findRole(String)
public boolean isAdmin()
User
isAdmin
in interface User
true
if the user is in the admin role, false
otherwisepublic boolean isSuperAdmin()
public boolean isLoggedOn()
User
isLoggedOn
in interface User
true
if the user is logged on, false
otherwiseUserManager.login(String, String)
,
UserManager.logout(User)
protected void setLoggedOn(boolean loggedOn)
public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |