Monitoring connect/close rather than attach/detach (as attach/detach is too low level, buried within the base HTTP tunnel implementation).

This commit is contained in:
Michael Jumper
2012-03-23 15:21:44 -07:00
parent d831969322
commit c2eb0744ac
4 changed files with 28 additions and 28 deletions

View File

@@ -4,35 +4,35 @@ import net.sourceforge.guacamole.net.GuacamoleTunnel;
import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.Credentials;
/** /**
* An event which is triggered whenever a tunnel is being detached from a * An event which is triggered whenever a tunnel is being closed. The tunnel
* session. The tunnel being detached can be accessed through getTunnel(), * being closed can be accessed through getTunnel(), and the set of all
* and the set of all credentials available from the request which is * credentials available from the request which is closing the tunnel can be
* detaching the tunnel can be retrieved using getCredentials(). * retrieved using getCredentials().
* *
* @author Michael Jumper * @author Michael Jumper
*/ */
public class TunnelDetachEvent implements CredentialEvent, TunnelEvent { public class TunnelCloseEvent implements CredentialEvent, TunnelEvent {
/** /**
* The credentials associated with the request that is detaching the * The credentials associated with the request that is closing the
* tunnel, if any. * tunnel, if any.
*/ */
private Credentials credentials; private Credentials credentials;
/** /**
* The tunnel being detached. * The tunnel being closed.
*/ */
private GuacamoleTunnel tunnel; private GuacamoleTunnel tunnel;
/** /**
* Creates a new TunnelDetachEvent which represents the detaching of the * Creates a new TunnelCloseEvent which represents the closing of the
* given tunnel via a request associated with the given credentials. * given tunnel via a request associated with the given credentials.
* *
* @param credentials The credentials associated with the request * @param credentials The credentials associated with the request
* detaching the tunnel. * closing the tunnel.
* @param tunnel The tunnel being detached. * @param tunnel The tunnel being closed.
*/ */
public TunnelDetachEvent(Credentials credentials, GuacamoleTunnel tunnel) { public TunnelCloseEvent(Credentials credentials, GuacamoleTunnel tunnel) {
this.credentials = credentials; this.credentials = credentials;
this.tunnel = tunnel; this.tunnel = tunnel;
} }

View File

@@ -4,35 +4,35 @@ import net.sourceforge.guacamole.net.GuacamoleTunnel;
import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.Credentials;
/** /**
* An event which is triggered whenever a tunnel is being attached to a * An event which is triggered whenever a tunnel is being connected. The tunnel
* session. The tunnel being attached can be accessed through getTunnel(), * being connected can be accessed through getTunnel(), and the set of all
* and the set of all credentials available from the request which is * credentials available from the request which is connecting the tunnel can be
* attaching the tunnel can be retrieved using getCredentials(). * retrieved using getCredentials().
* *
* @author Michael Jumper * @author Michael Jumper
*/ */
public class TunnelAttachEvent implements CredentialEvent, TunnelEvent { public class TunnelConnectEvent implements CredentialEvent, TunnelEvent {
/** /**
* The credentials associated with the request that is attaching the * The credentials associated with the request that is connecting the
* tunnel, if any. * tunnel, if any.
*/ */
private Credentials credentials; private Credentials credentials;
/** /**
* The tunnel being attached. * The tunnel being connected.
*/ */
private GuacamoleTunnel tunnel; private GuacamoleTunnel tunnel;
/** /**
* Creates a new TunnelAttachEvent which represents the attaching of the * Creates a new TunnelConnectEvent which represents the connecting of the
* given tunnel via a request associated with the given credentials. * given tunnel via a request associated with the given credentials.
* *
* @param credentials The credentials associated with the request * @param credentials The credentials associated with the request
* attaching the tunnel. * connecting the tunnel.
* @param tunnel The tunnel being attached. * @param tunnel The tunnel being connected.
*/ */
public TunnelAttachEvent(Credentials credentials, GuacamoleTunnel tunnel) { public TunnelConnectEvent(Credentials credentials, GuacamoleTunnel tunnel) {
this.credentials = credentials; this.credentials = credentials;
this.tunnel = tunnel; this.tunnel = tunnel;
} }

View File

@@ -1,7 +1,7 @@
package net.sourceforge.guacamole.net.event.listener; package net.sourceforge.guacamole.net.event.listener;
import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.GuacamoleException;
import net.sourceforge.guacamole.net.event.TunnelAttachEvent; import net.sourceforge.guacamole.net.event.TunnelConnectEvent;
/** /**
* A listener whose tunnelAttached() hook will fire immediately after a new * A listener whose tunnelAttached() hook will fire immediately after a new
@@ -16,7 +16,7 @@ public interface TunnelAttachListener {
* session. The return value of this hook dictates whether the tunnel is * session. The return value of this hook dictates whether the tunnel is
* allowed to be attached. * allowed to be attached.
* *
* @param e The TunnelAttachEvent describing the tunnel being attached and * @param e The TunnelConnectEvent describing the tunnel being attached and
* any associated credentials. * any associated credentials.
* @return true if the tunnel should be allowed to be attached, or false * @return true if the tunnel should be allowed to be attached, or false
* if the attempt should be denied, causing the attempt to * if the attempt should be denied, causing the attempt to
@@ -25,7 +25,7 @@ public interface TunnelAttachListener {
* tunnel attach event. Throwing an exception * tunnel attach event. Throwing an exception
* will also stop the tunnel from being attached. * will also stop the tunnel from being attached.
*/ */
public boolean tunnelAttached(TunnelAttachEvent e) public boolean tunnelAttached(TunnelConnectEvent e)
throws GuacamoleException; throws GuacamoleException;
} }

View File

@@ -1,7 +1,7 @@
package net.sourceforge.guacamole.net.event.listener; package net.sourceforge.guacamole.net.event.listener;
import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.GuacamoleException;
import net.sourceforge.guacamole.net.event.TunnelDetachEvent; import net.sourceforge.guacamole.net.event.TunnelCloseEvent;
/** /**
* A listener whose tunnelDetached() hook will fire immediately after an * A listener whose tunnelDetached() hook will fire immediately after an
@@ -16,7 +16,7 @@ public interface TunnelDetachListener {
* from a session. The return value of this hook dictates whether the * from a session. The return value of this hook dictates whether the
* tunnel is allowed to be detached. * tunnel is allowed to be detached.
* *
* @param e The TunnelDetachEvent describing the tunnel being detached and * @param e The TunnelCloseEvent describing the tunnel being detached and
* any associated credentials. * any associated credentials.
* @return true if the tunnel should be allowed to be detached, or false * @return true if the tunnel should be allowed to be detached, or false
* if the attempt should be denied, causing the attempt to * if the attempt should be denied, causing the attempt to
@@ -25,7 +25,7 @@ public interface TunnelDetachListener {
* tunnel detach event. Throwing an exception * tunnel detach event. Throwing an exception
* will also stop the tunnel from being detached. * will also stop the tunnel from being detached.
*/ */
public boolean tunnelDetached(TunnelDetachEvent e) public boolean tunnelDetached(TunnelCloseEvent e)
throws GuacamoleException; throws GuacamoleException;
} }