mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	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:
		| @@ -4,35 +4,35 @@ import net.sourceforge.guacamole.net.GuacamoleTunnel; | ||||
| import net.sourceforge.guacamole.net.auth.Credentials; | ||||
| 
 | ||||
| /** | ||||
|  * An event which is triggered whenever a tunnel is being detached from a | ||||
|  * session. The tunnel being detached can be accessed through getTunnel(), | ||||
|  * and the set of all credentials available from the request which is | ||||
|  * detaching the tunnel can be retrieved using getCredentials(). | ||||
|  * An event which is triggered whenever a tunnel is being closed. The tunnel | ||||
|  * being closed can be accessed through getTunnel(), and the set of all | ||||
|  * credentials available from the request which is closing the tunnel can be | ||||
|  * retrieved using getCredentials(). | ||||
|  *  | ||||
|  * @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. | ||||
|      */ | ||||
|     private Credentials credentials; | ||||
| 
 | ||||
|     /** | ||||
|      * The tunnel being detached. | ||||
|      * The tunnel being closed. | ||||
|      */ | ||||
|     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. | ||||
|      *  | ||||
|      * @param credentials The credentials associated with the request | ||||
|      *                    detaching the tunnel. | ||||
|      * @param tunnel The tunnel being detached. | ||||
|      *                    closing the tunnel. | ||||
|      * @param tunnel The tunnel being closed. | ||||
|      */ | ||||
|     public TunnelDetachEvent(Credentials credentials, GuacamoleTunnel tunnel) { | ||||
|     public TunnelCloseEvent(Credentials credentials, GuacamoleTunnel tunnel) { | ||||
|         this.credentials = credentials; | ||||
|         this.tunnel = tunnel; | ||||
|     } | ||||
| @@ -4,35 +4,35 @@ import net.sourceforge.guacamole.net.GuacamoleTunnel; | ||||
| import net.sourceforge.guacamole.net.auth.Credentials; | ||||
| 
 | ||||
| /** | ||||
|  * An event which is triggered whenever a tunnel is being attached to a | ||||
|  * session. The tunnel being attached can be accessed through getTunnel(), | ||||
|  * and the set of all credentials available from the request which is | ||||
|  * attaching the tunnel can be retrieved using getCredentials(). | ||||
|  * An event which is triggered whenever a tunnel is being connected. The tunnel | ||||
|  * being connected can be accessed through getTunnel(), and the set of all | ||||
|  * credentials available from the request which is connecting the tunnel can be | ||||
|  * retrieved using getCredentials(). | ||||
|  *  | ||||
|  * @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. | ||||
|      */ | ||||
|     private Credentials credentials; | ||||
| 
 | ||||
|     /** | ||||
|      * The tunnel being attached. | ||||
|      * The tunnel being connected. | ||||
|      */ | ||||
|     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. | ||||
|      *  | ||||
|      * @param credentials The credentials associated with the request | ||||
|      *                    attaching the tunnel. | ||||
|      * @param tunnel The tunnel being attached. | ||||
|      *                    connecting the tunnel. | ||||
|      * @param tunnel The tunnel being connected. | ||||
|      */ | ||||
|     public TunnelAttachEvent(Credentials credentials, GuacamoleTunnel tunnel) { | ||||
|     public TunnelConnectEvent(Credentials credentials, GuacamoleTunnel tunnel) { | ||||
|         this.credentials = credentials; | ||||
|         this.tunnel = tunnel; | ||||
|     } | ||||
| @@ -1,7 +1,7 @@ | ||||
| package net.sourceforge.guacamole.net.event.listener; | ||||
|  | ||||
| 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 | ||||
| @@ -16,7 +16,7 @@ public interface TunnelAttachListener { | ||||
|      * session. The return value of this hook dictates whether the tunnel is | ||||
|      * 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. | ||||
|      * @return true if the tunnel should be allowed to be attached, or false | ||||
|      *         if the attempt should be denied, causing the attempt to | ||||
| @@ -25,7 +25,7 @@ public interface TunnelAttachListener { | ||||
|      *                            tunnel attach event. Throwing an exception | ||||
|      *                            will also stop the tunnel from being attached. | ||||
|      */ | ||||
|     public boolean tunnelAttached(TunnelAttachEvent e) | ||||
|     public boolean tunnelAttached(TunnelConnectEvent e) | ||||
|             throws GuacamoleException; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| package net.sourceforge.guacamole.net.event.listener; | ||||
|  | ||||
| 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 | ||||
| @@ -16,7 +16,7 @@ public interface TunnelDetachListener { | ||||
|      * from a session. The return value of this hook dictates whether the | ||||
|      * 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. | ||||
|      * @return true if the tunnel should be allowed to be detached, or false | ||||
|      *         if the attempt should be denied, causing the attempt to | ||||
| @@ -25,7 +25,7 @@ public interface TunnelDetachListener { | ||||
|      *                            tunnel detach event. Throwing an exception | ||||
|      *                            will also stop the tunnel from being detached. | ||||
|      */ | ||||
|     public boolean tunnelDetached(TunnelDetachEvent e) | ||||
|     public boolean tunnelDetached(TunnelCloseEvent e) | ||||
|             throws GuacamoleException; | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user