mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Create CredentialEvent interface for generic credentials-related events. Implemented AuthenticationFailureEvent.
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
package net.sourceforge.guacamole.net.event;
|
||||||
|
|
||||||
|
import net.sourceforge.guacamole.net.auth.Credentials;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An event which is triggered whenever a user's credentials fail to be
|
||||||
|
* authenticated. The credentials that failed to be authenticated are included
|
||||||
|
* within this event, and can be retrieved using getCredentials().
|
||||||
|
*
|
||||||
|
* @author Michael Jumper
|
||||||
|
*/
|
||||||
|
public class AuthenticationFailureEvent implements CredentialEvent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The credentials which failed authentication
|
||||||
|
*/
|
||||||
|
private Credentials credentials;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new AuthenticationFailureEvent which represents the failure
|
||||||
|
* to authenticate the given credentials.
|
||||||
|
*
|
||||||
|
* @param credentials The credentials which failed authentication.
|
||||||
|
*/
|
||||||
|
public AuthenticationFailureEvent(Credentials credentials) {
|
||||||
|
this.credentials = credentials;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Credentials getCredentials() {
|
||||||
|
return credentials;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,21 @@
|
|||||||
|
package net.sourceforge.guacamole.net.event;
|
||||||
|
|
||||||
|
import net.sourceforge.guacamole.net.auth.Credentials;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract basis for events which may have associated user credentials when
|
||||||
|
* triggered.
|
||||||
|
*
|
||||||
|
* @author Michael Jumper
|
||||||
|
*/
|
||||||
|
public interface CredentialEvent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current credentials of the user triggering the event, if any.
|
||||||
|
*
|
||||||
|
* @return The current credentials of the user triggering the event, if
|
||||||
|
* any, or null if no credentials are associated with the event.
|
||||||
|
*/
|
||||||
|
public Credentials getCredentials();
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user