2020-01-28 18:58:44 +01:00
|
|
|
package envoy.event;
|
|
|
|
|
|
|
|
/**
|
2020-10-18 15:16:46 +02:00
|
|
|
* Signifies to the client that the handshake failed for the attached reason.
|
2020-01-28 18:58:44 +01:00
|
|
|
*
|
|
|
|
* @author Kai S. K. Engelbart
|
|
|
|
* @since Envoy Common v0.3-alpha
|
|
|
|
*/
|
2020-08-22 13:37:07 +02:00
|
|
|
public final class HandshakeRejection extends Event<String> {
|
2020-01-28 18:58:44 +01:00
|
|
|
|
2020-02-07 23:29:22 +01:00
|
|
|
/**
|
2020-06-23 08:23:40 +02:00
|
|
|
* Select this value if a given password hash or user name was incorrect.
|
2020-09-19 11:37:42 +02:00
|
|
|
*
|
2020-06-23 08:23:40 +02:00
|
|
|
* @since Envoy Common v0.3-alpha
|
2020-02-08 09:17:11 +01:00
|
|
|
*/
|
2020-06-11 13:55:38 +02:00
|
|
|
public static final String WRONG_PASSWORD_OR_USER = "Incorrect user name or password.";
|
2020-02-08 09:17:11 +01:00
|
|
|
|
2020-02-07 23:29:22 +01:00
|
|
|
/**
|
2020-06-23 08:23:40 +02:00
|
|
|
* Select this value if a given user name for a registration is already taken.
|
2020-09-19 11:37:42 +02:00
|
|
|
*
|
2020-06-23 08:23:40 +02:00
|
|
|
* @since Envoy Common v0.1-beta
|
|
|
|
*/
|
|
|
|
public static final String USERNAME_TAKEN = "Incorrect user name or password.";
|
|
|
|
|
|
|
|
/**
|
2020-10-18 15:16:46 +02:00
|
|
|
* Select this value if the version of the client is incompatible with the server.
|
2020-09-19 11:37:42 +02:00
|
|
|
*
|
2020-06-23 08:23:40 +02:00
|
|
|
* @since Envoy Common v0.1-beta
|
|
|
|
*/
|
|
|
|
public static final String WRONG_VERSION = "Incompatible client version";
|
|
|
|
|
2020-09-19 11:37:42 +02:00
|
|
|
/**
|
|
|
|
* Select this value if the client provided an invalid authentication token.
|
|
|
|
*
|
|
|
|
* @since Envoy Common v0.2-beta
|
|
|
|
*/
|
|
|
|
public static final String INVALID_TOKEN = "Invalid authentication token";
|
|
|
|
|
2020-06-23 08:23:40 +02:00
|
|
|
/**
|
2020-10-18 15:16:46 +02:00
|
|
|
* Select this value if the handshake could not be completed for some different reason.
|
2020-09-19 11:37:42 +02:00
|
|
|
*
|
2020-06-23 08:23:40 +02:00
|
|
|
* @since Envoy Common v0.3-alpha
|
2020-02-07 23:29:22 +01:00
|
|
|
*/
|
2020-06-11 13:55:38 +02:00
|
|
|
public static final String INTERNAL_ERROR = "An internal error occured.";
|
2020-02-07 23:29:22 +01:00
|
|
|
|
2020-03-24 19:06:56 +01:00
|
|
|
private static final long serialVersionUID = 0L;
|
2020-01-28 18:58:44 +01:00
|
|
|
|
|
|
|
/**
|
2020-06-23 08:23:40 +02:00
|
|
|
* Creates an instance of {@link HandshakeRejection} with the generic
|
|
|
|
* {@link HandshakeRejection#INTERNAL_ERROR} reason.
|
2020-01-28 18:58:44 +01:00
|
|
|
*
|
|
|
|
* @since Envoy Common v0.3-alpha
|
|
|
|
*/
|
2020-10-18 15:16:46 +02:00
|
|
|
public HandshakeRejection() {
|
|
|
|
super(INTERNAL_ERROR);
|
|
|
|
}
|
2020-01-28 18:58:44 +01:00
|
|
|
|
|
|
|
/**
|
2020-06-20 09:19:39 +02:00
|
|
|
* Creates an instance of {@link HandshakeRejection}.
|
2020-01-28 18:58:44 +01:00
|
|
|
*
|
|
|
|
* @param reason the reason why the handshake was rejected
|
|
|
|
* @since Envoy Common v0.3-alpha
|
|
|
|
*/
|
2020-10-18 15:16:46 +02:00
|
|
|
public HandshakeRejection(String reason) {
|
|
|
|
super(reason);
|
|
|
|
}
|
2020-01-28 18:58:44 +01:00
|
|
|
}
|