Author: glandais Date: 2008-02-04 14:32:52 +0000 (Mon, 04 Feb 2008) New Revision: 624 Removed: trunk/simexplorer-is-security/src/test/fr/ Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManager.java trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManagerImpl.java trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurity.java trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurityImpl.java trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Actor.java trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Group.java trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/LoginAction.java trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Permission.java trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/User.java Log: Javadoc Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManager.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManager.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManager.java 2008-02-04 14:32:52 UTC (rev 624) @@ -21,11 +21,34 @@ import fr.cemagref.simexplorer.is.security.entities.Permission; +/** + * The Interface CredentialManager. + */ @Local public interface CredentialManager { + /** + * Gets the permission. + * + * @param token + * the token + * @param businessId + * the business id + * + * @return the permission + */ public Permission getPermission(String token, String businessId); + /** + * Save element. + * + * @param token + * the token + * @param businessId + * the business id + * + * @return the permission + */ public Permission saveElement(String token, String businessId); } Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManagerImpl.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManagerImpl.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/credentials/CredentialManagerImpl.java 2008-02-04 14:32:52 UTC (rev 624) @@ -31,14 +31,28 @@ import fr.cemagref.simexplorer.is.security.entities.Permission; import fr.cemagref.simexplorer.is.security.entities.User; +/** + * The Class CredentialManagerImpl. + */ @Stateless(name = "CredentialManager") @Local(CredentialManager.class) @TransactionAttribute(TransactionAttributeType.REQUIRED) public class CredentialManagerImpl implements CredentialManager { + /** The dao. */ @EJB private DaoSecurity dao; + /** + * Gets the relative level. + * + * @param actor + * the actor + * @param permission + * the permission + * + * @return the relative level + */ private int getRelativeLevel(Actor actor, Permission permission) { int level = -1; if (actor.equals(permission.getActor())) { @@ -55,6 +69,9 @@ return level; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.credentials.CredentialManager#getPermission(java.lang.String, java.lang.String) + */ public Permission getPermission(String token, String businessId) { Permission p = null; @@ -89,6 +106,9 @@ return p; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.credentials.CredentialManager#saveElement(java.lang.String, java.lang.String) + */ public Permission saveElement(String token, String businessId) { Permission p = new Permission(); p.setActor(dao.getLoggedUser(token)); Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurity.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurity.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurity.java 2008-02-04 14:32:52 UTC (rev 624) @@ -24,36 +24,135 @@ import fr.cemagref.simexplorer.is.security.entities.Permission; import fr.cemagref.simexplorer.is.security.entities.User; +/** + * The Interface DaoSecurity. + */ public interface DaoSecurity { + /** + * Save user. + * + * @param user + * the user + */ public void saveUser(User user); + /** + * Gets the user. + * + * @param id + * the id + * + * @return the user + */ public User getUser(Integer id); + /** + * Gets the user. + * + * @param login + * the login + * + * @return the user + */ public User getUser(String login); + /** + * Update user. + * + * @param user + * the user + * + * @return the user + */ public User updateUser(User user); + /** + * Delete user. + * + * @param id + * the id + */ public void deleteUser(Integer id); + /** + * Save group. + * + * @param group + * the group + */ public void saveGroup(Group group); + /** + * Gets the group. + * + * @param id + * the id + * + * @return the group + */ public Group getGroup(Integer id); + /** + * Gets the group. + * + * @param name + * the name + * + * @return the group + */ public Group getGroup(String name); + /** + * Update group. + * + * @param group + * the group + * + * @return the group + */ public Group updateGroup(Group group); + /** + * Delete group. + * + * @param id + * the id + */ public void deleteGroup(Integer id); + /** + * Gets the logged user. + * + * @param token + * the token + * + * @return the logged user + */ public User getLoggedUser(String token); + /** + * Login user. + * + * @param login + * the login + * @param passwordHash + * the password hash + * + * @return the user + */ public User loginUser(String login, String passwordHash); + /** + * Save token. + * + * @param loginAction + * the login action + */ public void saveToken(LoginAction loginAction); /** - * Delete old tokens associated to user + * Delete old tokens associated to user. * * @param login * Login of user @@ -62,22 +161,86 @@ */ public void deleteTokens(String login, long before); + /** + * Gets the groups. + * + * @return the groups + */ public List<Group> getGroups(); + /** + * Gets the groups owned by. + * + * @param user + * the user + * + * @return the groups owned by + */ public List<Group> getGroupsOwnedBy(User user); + /** + * Gets the users. + * + * @return the users + */ public List<User> getUsers(); + /** + * Gets the users of group. + * + * @param group + * the group + * + * @return the users of group + */ public List<User> getUsersOfGroup(Group group); + /** + * Gets the groups of user. + * + * @param user + * the user + * + * @return the groups of user + */ public List<Group> getGroupsOfUser(User user); + /** + * Gets the groups of group. + * + * @param group + * the group + * + * @return the groups of group + */ public List<Group> getGroupsOfGroup(Group group); + /** + * Gets the permissions. + * + * @param businessId + * the business id + * + * @return the permissions + */ public List<Permission> getPermissions(String businessId); + /** + * Save permission. + * + * @param p + * the p + */ public void savePermission(Permission p); + /** + * Sets the permissions. + * + * @param uuid + * the uuid + * @param permissions + * the permissions + */ public void setPermissions(String uuid, Permission[] permissions); } Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurityImpl.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurityImpl.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/dao/DaoSecurityImpl.java 2008-02-04 14:32:52 UTC (rev 624) @@ -31,12 +31,24 @@ import fr.cemagref.simexplorer.is.security.entities.Permission; import fr.cemagref.simexplorer.is.security.entities.User; +/** + * The Class DaoSecurityImpl. + */ @Stateless(name = "DaoSecurity") public class DaoSecurityImpl implements DaoSecurity { + /** The em. */ @PersistenceContext(unitName = "simexploreris-security") private EntityManager em; + /** + * Gets the single result. + * + * @param query + * the query + * + * @return the single result + */ private Object getSingleResult(Query query) { Object o; try { @@ -47,6 +59,16 @@ return o; } + /** + * Find. + * + * @param clazz + * the clazz + * @param arg + * the arg + * + * @return the object + */ private Object find(Class<?> clazz, Object arg) { Object o; try { @@ -57,6 +79,9 @@ return o; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#deleteGroup(java.lang.Integer) + */ public void deleteGroup(Integer id) { Group g = getGroup(id); if (g != null) { @@ -64,6 +89,9 @@ } } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#deleteUser(java.lang.Integer) + */ public void deleteUser(Integer id) { User u = getUser(id); if (u != null) { @@ -71,11 +99,17 @@ } } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getGroup(java.lang.Integer) + */ public Group getGroup(Integer id) { Group g = (Group) find(Group.class, id); return g; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getGroup(java.lang.String) + */ public Group getGroup(String name) { Group g = (Group) getSingleResult(em.createQuery( "select g from Group g where g.name=:name").setParameter( @@ -83,27 +117,45 @@ return g; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getUser(java.lang.Integer) + */ public User getUser(Integer id) { User u = (User) find(User.class, id); return u; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#saveGroup(fr.cemagref.simexplorer.is.security.entities.Group) + */ public void saveGroup(Group group) { em.persist(group); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#saveUser(fr.cemagref.simexplorer.is.security.entities.User) + */ public void saveUser(User user) { em.persist(user); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#updateGroup(fr.cemagref.simexplorer.is.security.entities.Group) + */ public Group updateGroup(Group group) { return em.merge(group); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#updateUser(fr.cemagref.simexplorer.is.security.entities.User) + */ public User updateUser(User user) { return em.merge(user); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getLoggedUser(java.lang.String) + */ public User getLoggedUser(String token) { User loggedUser = null; LoginAction loginAction = (LoginAction) getSingleResult(em.createQuery( @@ -117,6 +169,9 @@ return loggedUser; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#loginUser(java.lang.String, java.lang.String) + */ public User loginUser(String login, String passwordHash) { User user = (User) getSingleResult(em .createQuery( @@ -126,20 +181,29 @@ return user; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#saveToken(fr.cemagref.simexplorer.is.security.entities.LoginAction) + */ public void saveToken(LoginAction loginAction) { em.persist(loginAction); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#deleteTokens(java.lang.String, long) + */ public void deleteTokens(String login, long before) { Date now = new Date(); Date date = new Date(now.getTime() - before); em .createQuery( "delete from LoginAction la where la.loggedUser.login = :login and la.time < :time") - .setParameter("time", date) - .setParameter("login", login).executeUpdate(); + .setParameter("time", date).setParameter("login", login) + .executeUpdate(); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getUser(java.lang.String) + */ public User getUser(String login) { User user = (User) getSingleResult(em.createQuery( "select u from User u where u.login=:login").setParameter( @@ -147,12 +211,20 @@ return user; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getGroups() + */ + @SuppressWarnings("unchecked") public List<Group> getGroups() { List<Group> groups = em.createQuery("select g from Group g") .getResultList(); return groups; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getGroupsOwnedBy(fr.cemagref.simexplorer.is.security.entities.User) + */ + @SuppressWarnings("unchecked") public List<Group> getGroupsOwnedBy(User user) { List<Group> groups = em.createQuery( "select g from Group g where g.owner=:owner").setParameter( @@ -160,12 +232,20 @@ return groups; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getUsers() + */ + @SuppressWarnings("unchecked") public List<User> getUsers() { List<User> users = em.createQuery("select u from User u") .getResultList(); return users; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getUsersOfGroup(fr.cemagref.simexplorer.is.security.entities.Group) + */ + @SuppressWarnings("unchecked") public List<User> getUsersOfGroup(Group group) { List<User> users = em .createQuery( @@ -174,6 +254,10 @@ return users; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getGroupsOfUser(fr.cemagref.simexplorer.is.security.entities.User) + */ + @SuppressWarnings("unchecked") public List<Group> getGroupsOfUser(User user) { List<Group> groups = em.createQuery( "select distinct u.groups from User u where u = :user") @@ -181,6 +265,10 @@ return groups; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getGroupsOfGroup(fr.cemagref.simexplorer.is.security.entities.Group) + */ + @SuppressWarnings("unchecked") public List<Group> getGroupsOfGroup(Group group) { List<Group> groups = em.createQuery( "select distinct g.groups from Group g where g = :group") @@ -188,6 +276,10 @@ return groups; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#getPermissions(java.lang.String) + */ + @SuppressWarnings("unchecked") public List<Permission> getPermissions(String businessId) { List<Permission> permissions = em.createQuery( "select p from Permission p where p.businessId=:businessId") @@ -195,10 +287,16 @@ return permissions; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#savePermission(fr.cemagref.simexplorer.is.security.entities.Permission) + */ public void savePermission(Permission p) { em.persist(p); } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.dao.DaoSecurity#setPermissions(java.lang.String, fr.cemagref.simexplorer.is.security.entities.Permission[]) + */ public void setPermissions(String uuid, Permission[] permissions) { em.createQuery( "delete from Permission p where p.businessId=:businessId") Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Actor.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Actor.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Actor.java 2008-02-04 14:32:52 UTC (rev 624) @@ -22,22 +22,44 @@ import java.util.Iterator; import java.util.List; +/** + * The Class Actor. + */ public class Actor implements Serializable { + /** The Constant serialVersionUID. */ private static final long serialVersionUID = 813823268950750281L; + /** The id. */ protected Integer id; + /** The groups. */ private List<Group> groups; + /** + * Gets the id. + * + * @return the id + */ public Integer getId() { return id; } + /** + * Sets the id. + * + * @param id + * the new id + */ public void setId(Integer id) { this.id = id; } + /** + * Gets the groups. + * + * @return the groups + */ public List<Group> getGroups() { if (groups == null) { groups = new ArrayList<Group>(); @@ -45,20 +67,37 @@ return groups; } + /** + * Sets the groups. + * + * @param groups + * the new groups + */ public void setGroups(List<Group> groups) { this.groups = groups; } - private int hashCodeGroups(List<Group> groups) { + /** + * Hash code groups. + * + * @param hashedGroups + * the hashed groups + * + * @return the int + */ + private int hashCodeGroups(List<Group> hashedGroups) { final int prime = 31; int result = 1; - result = prime * result + groups.size(); - for (Group group : groups) { + result = prime * result + hashedGroups.size(); + for (Group group : hashedGroups) { result = prime * result + ((group == null) ? 0 : group.getId()); } return result; } + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ @Override public int hashCode() { final int prime = 31; @@ -68,6 +107,16 @@ return result; } + /** + * Equals groups. + * + * @param groups1 + * the groups1 + * @param groups2 + * the groups2 + * + * @return true, if successful + */ private boolean equalsGroups(List<Group> groups1, List<Group> groups2) { if (groups1 == groups2) return true; @@ -90,6 +139,9 @@ return true; } + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ @Override public boolean equals(Object obj) { if (this == obj) Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Group.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Group.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Group.java 2008-02-04 14:32:52 UTC (rev 624) @@ -17,33 +17,67 @@ * ##% */ package fr.cemagref.simexplorer.is.security.entities; +/** + * The Class Group. + */ public class Group extends Actor { + /** The Constant serialVersionUID. */ private static final long serialVersionUID = 7378041114780247677L; + + /** The name. */ private String name; + + /** The owner. */ private User owner; + /** + * Gets the name. + * + * @return the name + */ public String getName() { return name; } + /** + * Sets the name. + * + * @param name the new name + */ public void setName(String name) { this.name = name; } + /** + * Gets the owner. + * + * @return the owner + */ public User getOwner() { return owner; } + /** + * Sets the owner. + * + * @param owner the new owner + */ public void setOwner(User owner) { this.owner = owner; } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ @Override public String toString() { return name; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.entities.Actor#hashCode() + */ @Override public int hashCode() { final int prime = 31; @@ -53,6 +87,9 @@ return result; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.entities.Actor#equals(java.lang.Object) + */ @Override public boolean equals(Object obj) { if (this == obj) Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/LoginAction.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/LoginAction.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/LoginAction.java 2008-02-04 14:32:52 UTC (rev 624) @@ -19,41 +19,91 @@ import java.util.Date; +/** + * The Class LoginAction. + */ public class LoginAction { + /** The id. */ private Integer id; + + /** The time. */ private Date time; + + /** The logged user. */ private User loggedUser; + + /** The token. */ private String token; + /** + * Gets the id. + * + * @return the id + */ public Integer getId() { return id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(Integer id) { this.id = id; } + /** + * Gets the time. + * + * @return the time + */ public Date getTime() { return time; } + /** + * Sets the time. + * + * @param time the new time + */ public void setTime(Date time) { this.time = time; } + /** + * Gets the logged user. + * + * @return the logged user + */ public User getLoggedUser() { return loggedUser; } + /** + * Sets the logged user. + * + * @param loggedUser the new logged user + */ public void setLoggedUser(User loggedUser) { this.loggedUser = loggedUser; } + /** + * Gets the token. + * + * @return the token + */ public String getToken() { return token; } + /** + * Sets the token. + * + * @param token the new token + */ public void setToken(String token) { this.token = token; } Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Permission.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Permission.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/Permission.java 2008-02-04 14:32:52 UTC (rev 624) @@ -19,70 +19,157 @@ import java.io.Serializable; +/** + * The Class Permission. + */ public class Permission implements Serializable { + /** The Constant serialVersionUID. */ private static final long serialVersionUID = 2753683847549451125L; + /** The id. */ private Integer id; + + /** The business id. */ private String businessId; + + /** The actor. */ private Actor actor; + + /** The can read. */ private boolean canRead; + + /** The can write. */ private boolean canWrite; + + /** The can admin. */ private boolean canAdmin; + + /** The is owner. */ private boolean isOwner; + /** + * Gets the id. + * + * @return the id + */ public Integer getId() { return id; } + /** + * Sets the id. + * + * @param id the new id + */ public void setId(Integer id) { this.id = id; } + /** + * Gets the business id. + * + * @return the business id + */ public String getBusinessId() { return businessId; } + /** + * Sets the business id. + * + * @param businessId the new business id + */ public void setBusinessId(String businessId) { this.businessId = businessId; } + /** + * Gets the actor. + * + * @return the actor + */ public Actor getActor() { return actor; } + /** + * Sets the actor. + * + * @param actor the new actor + */ public void setActor(Actor actor) { this.actor = actor; } + /** + * Checks if is can read. + * + * @return true, if is can read + */ public boolean isCanRead() { return canRead; } + /** + * Sets the can read. + * + * @param canRead the new can read + */ public void setCanRead(boolean canRead) { this.canRead = canRead; } + /** + * Checks if is can write. + * + * @return true, if is can write + */ public boolean isCanWrite() { return canWrite; } + /** + * Sets the can write. + * + * @param canWrite the new can write + */ public void setCanWrite(boolean canWrite) { this.canWrite = canWrite; } + /** + * Checks if is can admin. + * + * @return true, if is can admin + */ public boolean isCanAdmin() { return canAdmin; } + /** + * Sets the can admin. + * + * @param canAdmin the new can admin + */ public void setCanAdmin(boolean canAdmin) { this.canAdmin = canAdmin; } + /** + * Checks if is owner. + * + * @return true, if is owner + */ public boolean isOwner() { return isOwner; } + /** + * Sets the owner. + * + * @param isOwner the new owner + */ public void setOwner(boolean isOwner) { this.isOwner = isOwner; } Modified: trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/User.java =================================================================== --- trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/User.java 2008-02-04 14:32:23 UTC (rev 623) +++ trunk/simexplorer-is-security/src/java/fr/cemagref/simexplorer/is/security/entities/User.java 2008-02-04 14:32:52 UTC (rev 624) @@ -17,60 +17,130 @@ * ##% */ package fr.cemagref.simexplorer.is.security.entities; +/** + * The Class User. + */ public class User extends Actor { + /** The Constant serialVersionUID. */ private static final long serialVersionUID = -3031385996413945685L; + + /** The login. */ private String login; + + /** The mail. */ private String mail; + + /** The password hash. */ private String passwordHash; + + /** The admin. */ private boolean admin; + + /** The super admin. */ private boolean superAdmin; + /** + * Gets the login. + * + * @return the login + */ public String getLogin() { return login; } + /** + * Sets the login. + * + * @param login the new login + */ public void setLogin(String login) { this.login = login; } + /** + * Gets the mail. + * + * @return the mail + */ public String getMail() { return mail; } + /** + * Sets the mail. + * + * @param mail the new mail + */ public void setMail(String mail) { this.mail = mail; } + /** + * Gets the password hash. + * + * @return the password hash + */ public String getPasswordHash() { return passwordHash; } + /** + * Sets the password hash. + * + * @param passwordHash the new password hash + */ public void setPasswordHash(String passwordHash) { this.passwordHash = passwordHash; } + /** + * Checks if is admin. + * + * @return true, if is admin + */ public boolean isAdmin() { return admin; } + /** + * Sets the admin. + * + * @param admin the new admin + */ public void setAdmin(boolean admin) { this.admin = admin; } + /** + * Checks if is super admin. + * + * @return true, if is super admin + */ public boolean isSuperAdmin() { return superAdmin; } + /** + * Sets the super admin. + * + * @param superAdmin the new super admin + */ public void setSuperAdmin(boolean superAdmin) { this.superAdmin = superAdmin; } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ @Override public String toString() { return login; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.entities.Actor#hashCode() + */ @Override public int hashCode() { final int prime = 31; @@ -84,6 +154,9 @@ return result; } + /* (non-Javadoc) + * @see fr.cemagref.simexplorer.is.security.entities.Actor#equals(java.lang.Object) + */ @Override public boolean equals(Object obj) { if (this == obj)