diff --git a/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/event/listener/TunnelAttachListener.java b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/event/listener/TunnelAttachListener.java new file mode 100644 index 000000000..7936faef3 --- /dev/null +++ b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/event/listener/TunnelAttachListener.java @@ -0,0 +1,26 @@ +package net.sourceforge.guacamole.net.event.listener; + +import net.sourceforge.guacamole.net.event.TunnelAttachEvent; + +/** + * A listener whose tunnelAttached() hook will fire immediately after a new + * tunnel is attached to a session. + * + * @author Michael Jumper + */ +public interface TunnelAttachListener { + + /** + * Event hook which fires immediately after a new tunnel is attached to a + * 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 + * 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 + * effectively fail. + */ + public boolean tunnelAttached(TunnelAttachEvent e); + +} diff --git a/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/event/listener/TunnelDetachListener.java b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/event/listener/TunnelDetachListener.java new file mode 100644 index 000000000..9eea91f50 --- /dev/null +++ b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/event/listener/TunnelDetachListener.java @@ -0,0 +1,26 @@ +package net.sourceforge.guacamole.net.event.listener; + +import net.sourceforge.guacamole.net.event.TunnelDetachEvent; + +/** + * A listener whose tunnelDetached() hook will fire immediately after an + * existing tunnel is detached from a session. + * + * @author Michael Jumper + */ +public interface TunnelDetachListener { + + /** + * Event hook which fires immediately after an existing tunnel is detached + * 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 + * 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 + * effectively fail. + */ + public boolean tunnelDetached(TunnelDetachEvent e); + +}