org.sciplore.resources
Class User

java.lang.Object
  extended by org.sciplore.resources.Resource
      extended by org.sciplore.resources.User

@Entity
public class User
extends Resource


Field Summary
static Short USER_TYPE_ADMIN
           
static Short USER_TYPE_ANONYMOUS
           
static Short USER_TYPE_NORMAL
           
 
Constructor Summary
User()
           
User(String username)
           
User(String username, String password)
          Constructur
 
Method Summary
 boolean checkCredentials(String password)
           
 int createUserinDB()
          Creates a new user in the database
static String crypt(String password)
           
 Set<Alert> getAlterts()
           
 Set<Feedback> getFeedbacks()
           
 Integer getId()
           
 String getLang()
           
 Set<Mindmap> getMindmaps()
           
 Set<Newsletter> getNewsletters()
           
 String getPassword()
           
 Person getPerson()
           
 Date getRegistrationdate()
           
 String getRemark()
           
 Short getType()
           
static User getUser(String username)
           
 String getUsername()
           
 Short getValid()
           
 boolean isValidUser()
          Checks if user data is correct
 void setAlterts(Set<Alert> alterts)
           
 void setFeedbacks(Set<Feedback> feedbacks)
           
 void setId(Integer id)
           
 void setLang(String lang)
           
 void setMindmaps(Set<Mindmap> mindmaps)
           
 void setNewsletters(Set<Newsletter> newsletters)
           
 void setPassword(String password)
           
 void setPassword(String password, Boolean crypt)
           
 void setPerson(Person person)
           
 void setRegistrationdate(Date registrationdate)
           
 void setRemark(String remark)
           
 void setType(Short type)
           
 void setUsername(String username)
           
 void setValid(Short valid)
           
static User sync(User user)
           
 
Methods inherited from class org.sciplore.resources.Resource
save
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_TYPE_ADMIN

public static final Short USER_TYPE_ADMIN

USER_TYPE_NORMAL

public static final Short USER_TYPE_NORMAL

USER_TYPE_ANONYMOUS

public static final Short USER_TYPE_ANONYMOUS
Constructor Detail

User

public User()

User

public User(String username)

User

public User(String username,
            String password)
Constructur

Parameters:
username -
password -
Method Detail

crypt

public static String crypt(String password)

getUser

public static User getUser(String username)

isValidUser

public boolean isValidUser()
Checks if user data is correct

Parameters:
username -
password -
Returns:

checkCredentials

public boolean checkCredentials(String password)

createUserinDB

public int createUserinDB()
Creates a new user in the database

Returns:

getId

public Integer getId()
Returns:
the id

setId

public void setId(Integer id)
Parameters:
id - the id to set

getPerson

public Person getPerson()
Returns:
the person

setPerson

public void setPerson(Person person)
Parameters:
person - the person to set

getUsername

public String getUsername()
Returns:
the username

setUsername

public void setUsername(String username)
Parameters:
username - the username to set

getPassword

public String getPassword()
Returns:
the password

setPassword

public void setPassword(String password)
Parameters:
password - the password to set

setPassword

public void setPassword(String password,
                        Boolean crypt)

getType

public Short getType()
Returns:
the type

setType

public void setType(Short type)
Parameters:
type - the type to set

getLang

public String getLang()
Returns:
the lang

setLang

public void setLang(String lang)
Parameters:
lang - the lang to set

getValid

public Short getValid()
Returns:
the valid

setValid

public void setValid(Short valid)
Parameters:
valid - the valid to set

getRemark

public String getRemark()
Returns:
the remark

setRemark

public void setRemark(String remark)
Parameters:
remark - the remark to set

getRegistrationdate

public Date getRegistrationdate()
Returns:
the registrationdate

setRegistrationdate

public void setRegistrationdate(Date registrationdate)
Parameters:
registrationdate - the registrationdate to set

getAlterts

public Set<Alert> getAlterts()
Returns:
the alterts

setAlterts

public void setAlterts(Set<Alert> alterts)
Parameters:
alterts - the alterts to set

getFeedbacks

public Set<Feedback> getFeedbacks()
Returns:
the feedbacks

setFeedbacks

public void setFeedbacks(Set<Feedback> feedbacks)
Parameters:
feedbacks - the feedbacks to set

getMindmaps

public Set<Mindmap> getMindmaps()
Returns:
the mindmaps

setMindmaps

public void setMindmaps(Set<Mindmap> mindmaps)
Parameters:
mindmaps - the mindmaps to set

getNewsletters

public Set<Newsletter> getNewsletters()
Returns:
the newsletters

setNewsletters

public void setNewsletters(Set<Newsletter> newsletters)
Parameters:
newsletters - the newsletters to set

sync

public static User sync(User user)