64 lines
1.7 KiB
Java
64 lines
1.7 KiB
Java
package envoy.event;
|
|
|
|
/**
|
|
* Signifies to the client that the handshake failed for the attached
|
|
* reason.
|
|
* <p>
|
|
* Project: <strong>envoy-common</strong><br>
|
|
* File: <strong>HandshakeRejection.java</strong><br>
|
|
* Created: <strong>28 Jan 2020</strong><br>
|
|
*
|
|
* @author Kai S. K. Engelbart
|
|
* @since Envoy Common v0.3-alpha
|
|
*/
|
|
public class HandshakeRejection extends Event<String> {
|
|
|
|
/**
|
|
* 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 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); }
|
|
}
|