user docs corrected
This commit is contained in:
parent
0cee454356
commit
062b02da6c
@ -11,7 +11,8 @@ import javax.persistence.Id;
|
||||
import com.plannaplan.types.UserRoles;
|
||||
|
||||
/**
|
||||
* Entity of User grouping of state ssociated about id,name,surname,email,role,token,tokenCreatedDate
|
||||
* Entity of User grouping of state ssociated about
|
||||
* id,name,surname,email,role,token,tokenCreatedDate
|
||||
*/
|
||||
|
||||
@Entity
|
||||
@ -29,17 +30,15 @@ public class User {
|
||||
private String token;
|
||||
private Timestamp tokenUsageDate;
|
||||
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
/*
|
||||
* User
|
||||
/**
|
||||
*
|
||||
* @param name name given to the user
|
||||
* @param surname surname given to the user
|
||||
* @param email mail given to the user
|
||||
* @param role role given to the user
|
||||
* @param mail mail given to the user
|
||||
* @param role
|
||||
*/
|
||||
public User(String name, String surname, String mail, UserRoles role) {
|
||||
this.name = name;
|
||||
@ -48,134 +47,142 @@ public class User {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
/*
|
||||
* User
|
||||
/**
|
||||
*
|
||||
* @param name name given to the user
|
||||
* @param surname surname given to the user
|
||||
* @param email mail given to the user
|
||||
* @param mail mail given to the user
|
||||
* @param usosId id in the USOS system
|
||||
* @param role role given to the user
|
||||
* @param role
|
||||
*/
|
||||
public User(String name, String surname, String mail, String usosId, UserRoles role){
|
||||
this(name,surname,mail,role);
|
||||
public User(String name, String surname, String mail, String usosId, UserRoles role) {
|
||||
this(name, surname, mail, role);
|
||||
this.usosId = usosId;
|
||||
}
|
||||
|
||||
/*
|
||||
* getusosId
|
||||
/**
|
||||
* usos id getter
|
||||
*
|
||||
* @return usosId
|
||||
* @return usosid
|
||||
*/
|
||||
public String getUsosId() {
|
||||
return usosId;
|
||||
}
|
||||
|
||||
/*
|
||||
* getEmail
|
||||
/**
|
||||
* email getter
|
||||
*
|
||||
* @return email
|
||||
* @return mailof user
|
||||
*/
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
/*
|
||||
* setEmail
|
||||
/**
|
||||
* email setter
|
||||
*
|
||||
* @param email set email to the user
|
||||
* @param email user email
|
||||
*/
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
/*
|
||||
* getTokenUsageDate
|
||||
/**
|
||||
* token usage getter
|
||||
*
|
||||
* @return tokenUsageDate
|
||||
* @return Timestamp when token was used
|
||||
*/
|
||||
public Timestamp getTokenUsageDate() {
|
||||
return tokenUsageDate;
|
||||
}
|
||||
|
||||
/*
|
||||
* getToken
|
||||
/**
|
||||
* token getter
|
||||
*
|
||||
* @return token
|
||||
* @return user token
|
||||
*/
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
/*
|
||||
* setToken
|
||||
/**
|
||||
* token seter. Sets token and automaticly set time when was set
|
||||
*
|
||||
* @param token set token to the entity
|
||||
* @param token token to set
|
||||
*/
|
||||
public void setToken(String token) {
|
||||
this.tokenUsageDate = new Timestamp(System.currentTimeMillis());
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
/* getName
|
||||
/**
|
||||
* name setter
|
||||
*
|
||||
* @return name
|
||||
* @return String user name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/* getRole
|
||||
/**
|
||||
* user rolse getter
|
||||
*
|
||||
* @return role
|
||||
* @return UserRoles of user
|
||||
*/
|
||||
public UserRoles getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
/* setRole
|
||||
/**
|
||||
* user role setter
|
||||
*
|
||||
* @param role set role to the entity
|
||||
* @param role to be set
|
||||
*/
|
||||
public void setRole(UserRoles role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
/*
|
||||
* getSurname
|
||||
* @return surname
|
||||
/**
|
||||
* surname getter
|
||||
*
|
||||
* @return string surname
|
||||
*/
|
||||
public String getSurname() {
|
||||
return surname;
|
||||
}
|
||||
|
||||
/*
|
||||
* setSurname
|
||||
* @param surname set surname into entity user
|
||||
/**
|
||||
* surname setter
|
||||
*
|
||||
* @param surname string to be set as surnames
|
||||
*/
|
||||
public void setSurname(String surname) {
|
||||
this.surname = surname;
|
||||
}
|
||||
|
||||
/*
|
||||
* setName
|
||||
* @param name set name into entity user
|
||||
/**
|
||||
* name stter
|
||||
*
|
||||
* @param name stirng to be set as name
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/*
|
||||
* getId
|
||||
* @return id
|
||||
/**
|
||||
* id getter
|
||||
*
|
||||
* @return id in database
|
||||
*/
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/*
|
||||
* isCredentialsNonExpired
|
||||
* Returns TRUE if is Credentials Non Expired in the otherwise it returns false
|
||||
/**
|
||||
* it checks if given ammount of time passed since last token usage. If not
|
||||
* retunr true and reset time otherwise return false and token won work anymore
|
||||
*
|
||||
* @return boolena if credentials (token) is expired or not
|
||||
*/
|
||||
public boolean isCredentialsNonExpired() {
|
||||
final long diffInMilliseconds = Math
|
||||
|
Loading…
Reference in New Issue
Block a user