package envoy.event; /** * Signifies to the client that the handshake failed for the attached reason. * * @author Kai S. K. Engelbart * @since Envoy Common v0.3-alpha */ public final class HandshakeRejection extends Event { /** * Select this value if a given password hash or user name was incorrect. * * @since Envoy Common v0.3-alpha */ public static final String WRONG_PASSWORD_OR_USER = "Incorrect user name or password."; /** * Select this value if a given user name for a registration is already taken. * * @since Envoy Common v0.1-beta */ public static final String USERNAME_TAKEN = "Incorrect user name or password."; /** * Select this value if the version of the client is incompatible with the server. * * @since Envoy Common v0.1-beta */ public static final String WRONG_VERSION = "Incompatible client version"; /** * 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"; /** * Select this value if the handshake could not be completed for some different reason. * * @since Envoy Common v0.3-alpha */ public static final String INTERNAL_ERROR = "An internal error occured."; private static final long serialVersionUID = 0L; /** * Creates an instance of {@link HandshakeRejection} with the generic * {@link HandshakeRejection#INTERNAL_ERROR} reason. * * @since Envoy Common v0.3-alpha */ public HandshakeRejection() { super(INTERNAL_ERROR); } /** * Creates an instance of {@link HandshakeRejection}. * * @param reason the reason why the handshake was rejected * @since Envoy Common v0.3-alpha */ public HandshakeRejection(String reason) { super(reason); } }