1 |
49224
|
panagiotis
|
package eu.dnetlib.repo.manager.service.application.shared;
|
2 |
|
|
|
3 |
|
|
import com.google.gwt.user.client.rpc.IsSerializable;
|
4 |
|
|
|
5 |
|
|
/**
|
6 |
|
|
* Created by nikonas on 7/12/15.
|
7 |
|
|
*/
|
8 |
|
|
public class UserAccessException extends Exception implements IsSerializable {
|
9 |
|
|
|
10 |
|
|
public enum ErrorCode implements IsSerializable {
|
11 |
|
|
USER_ALREADY_EXISTS,
|
12 |
|
|
SQL_ERROR,
|
13 |
|
|
INVALID_USERNAME,
|
14 |
|
|
INVALID_PASSWORD,
|
15 |
|
|
NOT_ACTIVATED,
|
16 |
|
|
ACTIVATION_ERROR,
|
17 |
|
|
LDAP_ERROR,
|
18 |
|
|
USERNAME_ALREADY_EXISTS, MAIL_ALREADY_EXISTS, GENERAL_ERROR, ALREADY_ACTIVATED, INVALID_EMAIL_FORMAT, WRONG_SECURITY_CODE, INCORRECT_CAPTCHA
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
private ErrorCode errorCode = null;
|
22 |
|
|
|
23 |
|
|
public UserAccessException() {
|
24 |
|
|
}
|
25 |
|
|
|
26 |
|
|
public UserAccessException(ErrorCode errorCode) {
|
27 |
|
|
this.errorCode = errorCode;
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
public UserAccessException(String message, Throwable cause, ErrorCode errorCode) {
|
31 |
|
|
super(message, cause);
|
32 |
|
|
|
33 |
|
|
this.errorCode = errorCode;
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
public UserAccessException(String message, ErrorCode errorCode) {
|
37 |
|
|
super(message);
|
38 |
|
|
|
39 |
|
|
this.errorCode = errorCode;
|
40 |
|
|
}
|
41 |
|
|
|
42 |
|
|
public UserAccessException(Throwable cause, ErrorCode errorCode) {
|
43 |
|
|
super(cause);
|
44 |
|
|
|
45 |
|
|
this.errorCode = errorCode;
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
public ErrorCode getErrorCode() {
|
49 |
|
|
return errorCode;
|
50 |
|
|
}
|
51 |
|
|
}
|