|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.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 Usernullpublic String getUsername()
User
getUsername in interface Usernull)User.getId(),
UserManager.createUser(String, String, Map),
UserManager.getUserByUsername(String)protected static String extractUsername(String userid)
public String getId()
User
getId in interface Usernull)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()
RateablegetRatings() methods of RatingManager.
getRatings in interface RateablenullRating,
RatingManagerpublic double getAverageRatingValue()
Rateable
getAverageRatingValue in interface Rateablepublic int getRatingsCount()
Rateable
getRatingsCount in interface Rateable
public Rating addRating(User rater,
double value)
throws RatingManagerException,
DynamicRightsManagerException
RateableRatingManager methods.
addRating in interface Rateablerater - 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)
RateablegetRatings() methods of RatingManager.
getRating in interface Rateableuser - the user who's rating shall be returned
null if the user hasn't rated this element yetRatingManagerpublic double getAverageOwnRatingsValue()
User
getAverageOwnRatingsValue in interface Userpublic Collection getOwnRatings()
UserRatingManager method.
getOwnRatings in interface UsernullRating,
RatingManager.getUsersOwnRatings(User)public int getOwnRatingsCount()
User
getOwnRatingsCount in interface Userpublic String getComment()
Commentatable
getComment in interface Commentatablenull)
public void setComment(User setter,
String comment)
throws OntologyManagerException,
DynamicRightsManagerException
Commentatable
setComment in interface Commentatablesetter - 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 Comparablepublic void setScore(double score)
User
setScore in interface Userscore - the new score (an absolute value, not a delta value!)User.getScore(),
ScoringListenerpublic double getScore()
User
getScore in interface UserUser.setScore(double),
IncentiveManager.getInitialUserScore(),
ScoringListenerpublic void addRole(UserRole role)
User
addRole in interface Userrole - the UserRole to addUserManager.findRole(String)public Collection getRoles()
User
getRoles in interface UsernullUserRolepublic boolean isInRole(UserRole role)
User
isInRole in interface Userrole - 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 Userrole - the UserRole to removeUserManager.findRole(String)public boolean isAdmin()
User
isAdmin in interface Usertrue if the user is in the admin role, false otherwisepublic boolean isSuperAdmin()
public boolean isLoggedOn()
User
isLoggedOn in interface Usertrue 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.HttpSessionBindingListenerpublic 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 | ||||||||||