Policy failures:
Code warning - failed on resource users. Reason: The field User.password is never read locally, line 24 - failed on resource User.java. Reason: The field User.password is never read locally, line 2 Override reason: s
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="ejbModule"/>
|
||||
<classpathentry kind="src" path="test"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/JVM 1.5.0 (MacOS X Default)"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.generic.runtimeTarget/JBoss v5.0"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.generic.runtimeTarget/JBoss v4.2"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.yacos.core.conferences;
|
||||
|
||||
/**
|
||||
* @author christiancorsano
|
||||
* TODO
|
||||
*/
|
||||
public class Conference {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package org.yacos.core.conferences;
|
||||
|
||||
public class ConferenceManager {
|
||||
//TODO
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package org.yacos.core.conferences;
|
||||
|
||||
public interface IConferenceManager {
|
||||
// TODO
|
||||
}
|
||||
68
YACOSCore/ejbModule/org/yacos/core/users/Role.java
Normal file
68
YACOSCore/ejbModule/org/yacos/core/users/Role.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package org.yacos.core.users;
|
||||
|
||||
import org.yacos.core.conferences.Conference;
|
||||
|
||||
/**
|
||||
* An role of a given type (author,chairman,PCmember or referee)
|
||||
* defined for a user and a conference
|
||||
* @author christiancorsano
|
||||
*
|
||||
*/
|
||||
public class Role {
|
||||
/**
|
||||
* User for which this role is defined
|
||||
*/
|
||||
private User user;
|
||||
/**
|
||||
* Conference for which this role is defined
|
||||
*/
|
||||
private Conference conference;
|
||||
/**
|
||||
* The type of this role
|
||||
*/
|
||||
private RoleType type;
|
||||
|
||||
public Role(RoleType type,User user, Conference conference) {
|
||||
super();
|
||||
setType(type);
|
||||
setUser(user);
|
||||
setConference(conference);
|
||||
}
|
||||
/**
|
||||
* @return the user who plays this role
|
||||
*/
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
/**
|
||||
* @param user the user who is to play this role
|
||||
*/
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
/**
|
||||
* @return the conference for which this role is defined
|
||||
*/
|
||||
public Conference getConference() {
|
||||
return conference;
|
||||
}
|
||||
/**
|
||||
* @param conference the conference for which this role is defined
|
||||
*/
|
||||
public void setConference(Conference conference) {
|
||||
this.conference = conference;
|
||||
}
|
||||
/**
|
||||
* @return the type of this role
|
||||
*/
|
||||
public RoleType getType() {
|
||||
return type;
|
||||
}
|
||||
/**
|
||||
* @param type the type of this role
|
||||
*/
|
||||
public void setType(RoleType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
48
YACOSCore/ejbModule/org/yacos/core/users/RoleType.java
Normal file
48
YACOSCore/ejbModule/org/yacos/core/users/RoleType.java
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.yacos.core.users;
|
||||
|
||||
/**
|
||||
* @author christiancorsano
|
||||
*
|
||||
*/
|
||||
public class RoleType {
|
||||
/**
|
||||
* Author constant role
|
||||
*/
|
||||
static public final RoleType author = new RoleType("author");
|
||||
/**
|
||||
* Chairman constant role
|
||||
*/
|
||||
static public final RoleType chairman = new RoleType("chairman");
|
||||
/**
|
||||
* PCMember constant role
|
||||
*/
|
||||
static public final RoleType PCmember = new RoleType("PCmember");
|
||||
/**
|
||||
* Referee constant role
|
||||
*/
|
||||
static public final RoleType Referee = new RoleType("referee");
|
||||
|
||||
/**
|
||||
* Name of this role type
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Private constructor : used to instanciate the constants
|
||||
* @param name Name of the new RoleType
|
||||
*/
|
||||
private RoleType(String name){
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of this RoleType
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
107
YACOSCore/ejbModule/org/yacos/core/users/User.java
Normal file
107
YACOSCore/ejbModule/org/yacos/core/users/User.java
Normal file
@@ -0,0 +1,107 @@
|
||||
package org.yacos.core.users;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.yacos.core.conferences.Conference;
|
||||
|
||||
|
||||
/**
|
||||
* A unique User of the system.
|
||||
* The user is registered globally in the application and would be able to get different roles for
|
||||
* different conferences.
|
||||
* @author christiancorsano
|
||||
*
|
||||
*/
|
||||
public class User {
|
||||
/**
|
||||
* Unique login of the user
|
||||
* Is used to identify the user, should be unique and can't be modified
|
||||
*/
|
||||
private String login;
|
||||
/**
|
||||
* Password : used for authentication purpose only, is only writable
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* First Name of the user
|
||||
*/
|
||||
private String firstName;
|
||||
/**
|
||||
* Last name of the user
|
||||
*/
|
||||
private String lastName;
|
||||
/**
|
||||
* Organization or lab the user belongs to
|
||||
*/
|
||||
private String organization;
|
||||
/**
|
||||
* Active email (has to be used frequently) of the user
|
||||
*/
|
||||
private String email;
|
||||
|
||||
public User() {
|
||||
|
||||
}
|
||||
|
||||
public String getLogin() {
|
||||
return login;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
|
||||
public void setOrganization(String organization) {
|
||||
this.organization = organization;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public void addRole(Role role){
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void addRoleForConference(RoleType roleType, Conference conference){
|
||||
if(! hasRoleForConference(roleType)){
|
||||
|
||||
} else {
|
||||
// TODO : declare and throw an exception
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasRoleForConference(RoleType roleType){
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
public Set<Role> getRoles(){
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
}
|
||||
33
YACOSCore/ejbModule/org/yacos/core/users/UsersManager.java
Normal file
33
YACOSCore/ejbModule/org/yacos/core/users/UsersManager.java
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.yacos.core.users;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author christiancorsano
|
||||
*
|
||||
*/
|
||||
public class UsersManager {
|
||||
public Collection<User> getUsers(){
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a user into the system
|
||||
* @param user
|
||||
*/
|
||||
public void addUser(User user){
|
||||
// TODO
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a user from the system
|
||||
* @param user
|
||||
*/
|
||||
public void removeUser(User user){
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user