2020-01-28 18:58:44 +01:00
|
|
|
package envoy.event;
|
|
|
|
|
2020-02-07 23:29:22 +01:00
|
|
|
import envoy.data.LoginCredentials;
|
|
|
|
|
2020-01-28 18:58:44 +01:00
|
|
|
/**
|
|
|
|
* Signifies to the client that the handshake failed for the attached
|
|
|
|
* reason.<br>
|
|
|
|
* <br>
|
|
|
|
* Project: <strong>envoy-common</strong><br>
|
|
|
|
* File: <strong>HandshakeRejectionEvent.java</strong><br>
|
|
|
|
* Created: <strong>28 Jan 2020</strong><br>
|
|
|
|
*
|
|
|
|
* @author Kai S. K. Engelbart
|
|
|
|
* @since Envoy Common v0.3-alpha
|
|
|
|
*/
|
2020-02-11 16:53:41 +01:00
|
|
|
public class HandshakeRejectionEvent extends Event<String> {
|
2020-01-28 18:58:44 +01:00
|
|
|
|
2020-02-07 23:29:22 +01:00
|
|
|
/**
|
|
|
|
* Select this value if a given password hash was incorrect
|
|
|
|
*/
|
|
|
|
public static final String WRONG_PASSWORD = "an incorrect password was entered";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Select this value if a given {@link LoginCredentials} pointed at a client who
|
|
|
|
* is already online
|
|
|
|
*/
|
|
|
|
public static final String ALREADY_ONLINE = "user is already online";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Select this value if a given {@link LoginCredentials} pointed at a client who
|
|
|
|
* does not exist
|
|
|
|
*/
|
|
|
|
public static final String USER_DOES_NOT_EXIST = "user does not exist";
|
|
|
|
|
2020-02-08 09:17:11 +01:00
|
|
|
/**
|
|
|
|
* Select this value if a given {@link LoginCredentials} with
|
|
|
|
* {@link LoginCredentials#isRegistration()}==true points at an already existing
|
|
|
|
* user
|
|
|
|
*/
|
|
|
|
public static final String USER_EXISTS_ALREADY = "user can not be created as he already exists";
|
|
|
|
|
2020-02-07 23:29:22 +01:00
|
|
|
/**
|
|
|
|
* Select this value if an unknown error occurred
|
|
|
|
*/
|
|
|
|
public static final String UNKNOWN_REASON = "cause of failure is unknown";
|
|
|
|
|
2020-01-28 18:58:44 +01:00
|
|
|
private static final long serialVersionUID = -8723270093452609197L;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an instance of {@link HandshakeRejectionEvent} with an empty reason.
|
|
|
|
*
|
|
|
|
* @since Envoy Common v0.3-alpha
|
|
|
|
*/
|
2020-02-11 16:53:41 +01:00
|
|
|
public HandshakeRejectionEvent() { super(""); }
|
2020-01-28 18:58:44 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an instance of {@link HandshakeRejectionEvent}.
|
|
|
|
*
|
|
|
|
* @param reason the reason why the handshake was rejected
|
|
|
|
* @since Envoy Common v0.3-alpha
|
|
|
|
*/
|
2020-02-12 05:58:40 +01:00
|
|
|
public HandshakeRejectionEvent(String reason) { super(reason); }
|
2020-01-28 18:58:44 +01:00
|
|
|
}
|