Restore caching of credentials in session. Update credentials when context is updated. Add credentials to events.

This commit is contained in:
Michael Jumper
2013-08-08 11:52:39 -07:00
parent 49ea114780
commit ea36b4f556
4 changed files with 76 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
package net.sourceforge.guacamole.net.event;
import net.sourceforge.guacamole.net.GuacamoleTunnel;
import net.sourceforge.guacamole.net.auth.Credentials;
import net.sourceforge.guacamole.net.auth.UserContext;
/**
@@ -11,14 +12,20 @@ import net.sourceforge.guacamole.net.auth.UserContext;
*
* @author Michael Jumper
*/
public class TunnelCloseEvent implements UserEvent, TunnelEvent {
public class TunnelCloseEvent implements UserEvent, CredentialEvent, TunnelEvent {
/**
* The UserContext associated with the request that is connecting the
* The UserContext associated with the request that is closing the
* tunnel, if any.
*/
private UserContext context;
/**
* The credentials associated with the request that connected the
* tunnel, if any.
*/
private Credentials credentials;
/**
* The tunnel being closed.
*/
@@ -28,12 +35,16 @@ public class TunnelCloseEvent implements UserEvent, TunnelEvent {
* Creates a new TunnelCloseEvent which represents the closing of the
* given tunnel via a request associated with the given credentials.
*
* @param context The UserContext associated with the request connecting
* @param context The UserContext associated with the request closing
* the tunnel.
* @param credentials The credentials associated with the request that
* connected the tunnel.
* @param tunnel The tunnel being closed.
*/
public TunnelCloseEvent(UserContext context, GuacamoleTunnel tunnel) {
public TunnelCloseEvent(UserContext context, Credentials credentials,
GuacamoleTunnel tunnel) {
this.context = context;
this.credentials = credentials;
this.tunnel = tunnel;
}
@@ -42,6 +53,11 @@ public class TunnelCloseEvent implements UserEvent, TunnelEvent {
return context;
}
@Override
public Credentials getCredentials() {
return credentials;
}
@Override
public GuacamoleTunnel getTunnel() {
return tunnel;

View File

@@ -1,6 +1,7 @@
package net.sourceforge.guacamole.net.event;
import net.sourceforge.guacamole.net.GuacamoleTunnel;
import net.sourceforge.guacamole.net.auth.Credentials;
import net.sourceforge.guacamole.net.auth.UserContext;
/**
@@ -12,7 +13,7 @@ import net.sourceforge.guacamole.net.auth.UserContext;
*
* @author Michael Jumper
*/
public class TunnelConnectEvent implements UserEvent, TunnelEvent {
public class TunnelConnectEvent implements UserEvent, CredentialEvent, TunnelEvent {
/**
* The UserContext associated with the request that is connecting the
@@ -20,6 +21,12 @@ public class TunnelConnectEvent implements UserEvent, TunnelEvent {
*/
private UserContext context;
/**
* The credentials associated with the request that is connecting the
* tunnel, if any.
*/
private Credentials credentials;
/**
* The tunnel being connected.
*/
@@ -31,10 +38,14 @@ public class TunnelConnectEvent implements UserEvent, TunnelEvent {
*
* @param context The UserContext associated with the request connecting
* the tunnel.
* @param credentials The credentials associated with the request connecting
* the tunnel.
* @param tunnel The tunnel being connected.
*/
public TunnelConnectEvent(UserContext context, GuacamoleTunnel tunnel) {
public TunnelConnectEvent(UserContext context, Credentials credentials,
GuacamoleTunnel tunnel) {
this.context = context;
this.credentials = credentials;
this.tunnel = tunnel;
}
@@ -43,6 +54,11 @@ public class TunnelConnectEvent implements UserEvent, TunnelEvent {
return context;
}
@Override
public Credentials getCredentials() {
return credentials;
}
@Override
public GuacamoleTunnel getTunnel() {
return tunnel;