diff --git a/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleAuthenticationRejectedException.java b/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleAuthenticationRejectedException.java index 7d7bfa870..907e0c947 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleAuthenticationRejectedException.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleAuthenticationRejectedException.java @@ -15,7 +15,6 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ package org.apache.guacamole; diff --git a/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelConnectedException.java b/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelConnectedException.java index 96693a483..c7d21cf1d 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelConnectedException.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelConnectedException.java @@ -15,7 +15,6 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ package org.apache.guacamole; diff --git a/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelRejectedException.java b/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelRejectedException.java index c2e09f927..b9367c180 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelRejectedException.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelRejectedException.java @@ -15,7 +15,6 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ package org.apache.guacamole; diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/AuthenticationFailureListener.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/AuthenticationFailureListener.java index 7fa619042..86122bad2 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/AuthenticationFailureListener.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/AuthenticationFailureListener.java @@ -28,6 +28,7 @@ import org.apache.guacamole.net.event.AuthenticationFailureEvent; * be used to cancel the authentication failure. */ public interface AuthenticationFailureListener extends Listener { + /** * Event hook which fires immediately after a user's authentication attempt * fails. diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/Listener.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/Listener.java index 72f859db1..58499934e 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/Listener.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/Listener.java @@ -15,7 +15,6 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ package org.apache.guacamole.net.event.listener; diff --git a/guacamole/src/main/java/org/apache/guacamole/extension/Extension.java b/guacamole/src/main/java/org/apache/guacamole/extension/Extension.java index ac58676ec..697002d42 100644 --- a/guacamole/src/main/java/org/apache/guacamole/extension/Extension.java +++ b/guacamole/src/main/java/org/apache/guacamole/extension/Extension.java @@ -35,7 +35,6 @@ import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; - import org.apache.guacamole.net.event.listener.Listener; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.ObjectMapper; diff --git a/guacamole/src/main/java/org/apache/guacamole/extension/ListenerFacade.java b/guacamole/src/main/java/org/apache/guacamole/extension/ListenerFacade.java index 278b2a934..ab0b7c85d 100644 --- a/guacamole/src/main/java/org/apache/guacamole/extension/ListenerFacade.java +++ b/guacamole/src/main/java/org/apache/guacamole/extension/ListenerFacade.java @@ -15,7 +15,6 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ package org.apache.guacamole.extension; @@ -56,7 +55,7 @@ class ListenerFacade implements ListenerProvider { * listener implements the AuthenticationSuccessListener interface. * * @param - * e The AuthenticationSuccessEvent describing the authentication + * event The AuthenticationSuccessEvent describing the authentication * success that just occurred. * @return * false if the delegate listener rejects the successful authentication, @@ -66,10 +65,10 @@ class ListenerFacade implements ListenerProvider { * if the delegate listener throws this exception */ @Override - public boolean authenticationSucceeded(AuthenticationSuccessEvent e) + public boolean authenticationSucceeded(AuthenticationSuccessEvent event) throws GuacamoleException { return !(delegate instanceof AuthenticationSuccessListener) - || ((AuthenticationSuccessListener) delegate).authenticationSucceeded(e); + || ((AuthenticationSuccessListener) delegate).authenticationSucceeded(event); } /** @@ -77,17 +76,17 @@ class ListenerFacade implements ListenerProvider { * listener implements the AuthenticationSuccessListener interface. * * @param - * e The AuthenticationFailureEvent describing the authentication + * event The AuthenticationFailureEvent describing the authentication * failure that just occurred. * * @throws GuacamoleException * if the delegate listener throws this exception */ @Override - public void authenticationFailed(AuthenticationFailureEvent e) + public void authenticationFailed(AuthenticationFailureEvent event) throws GuacamoleException { if (delegate instanceof AuthenticationFailureListener) { - ((AuthenticationFailureListener) delegate).authenticationFailed(e); + ((AuthenticationFailureListener) delegate).authenticationFailed(event); } } @@ -96,7 +95,7 @@ class ListenerFacade implements ListenerProvider { * listener implements the TunnelConnectListener interface. * * @param - * e The TunnelConnectEvent describing the tunnel that was just connected + * event The TunnelConnectEvent describing the tunnel that was just connected * @return * false if the delegate listener rejects the tunnel connection, @@ -106,10 +105,10 @@ class ListenerFacade implements ListenerProvider { * if the delegate listener throws this exception */ @Override - public boolean tunnelConnected(TunnelConnectEvent e) + public boolean tunnelConnected(TunnelConnectEvent event) throws GuacamoleException { return !(delegate instanceof TunnelConnectListener) - || ((TunnelConnectListener) delegate).tunnelConnected(e); + || ((TunnelConnectListener) delegate).tunnelConnected(event); } /** @@ -117,7 +116,7 @@ class ListenerFacade implements ListenerProvider { * listener implements the TunnelCloseListener interface. * * @param - * e The TunnelCloseEvent describing the tunnel that is to be close + * event The TunnelCloseEvent describing the tunnel that is to be close * @return * false if the delegate listener rejects the tunnel close request, @@ -127,9 +126,9 @@ class ListenerFacade implements ListenerProvider { * if the delegate listener throws this exception */ @Override - public boolean tunnelClosed(TunnelCloseEvent e) throws GuacamoleException { + public boolean tunnelClosed(TunnelCloseEvent event) throws GuacamoleException { return !(delegate instanceof TunnelCloseListener) - || ((TunnelCloseListener) delegate).tunnelClosed(e); + || ((TunnelCloseListener) delegate).tunnelClosed(event); } } diff --git a/guacamole/src/main/java/org/apache/guacamole/extension/ListenerProvider.java b/guacamole/src/main/java/org/apache/guacamole/extension/ListenerProvider.java index 0b3a7473d..1d8afc10c 100644 --- a/guacamole/src/main/java/org/apache/guacamole/extension/ListenerProvider.java +++ b/guacamole/src/main/java/org/apache/guacamole/extension/ListenerProvider.java @@ -15,7 +15,6 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ package org.apache.guacamole.extension; diff --git a/guacamole/src/main/java/org/apache/guacamole/extension/ProviderFactory.java b/guacamole/src/main/java/org/apache/guacamole/extension/ProviderFactory.java index 0620b4da8..376b213d6 100644 --- a/guacamole/src/main/java/org/apache/guacamole/extension/ProviderFactory.java +++ b/guacamole/src/main/java/org/apache/guacamole/extension/ProviderFactory.java @@ -15,7 +15,6 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ package org.apache.guacamole.extension; diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/auth/AuthenticationService.java b/guacamole/src/main/java/org/apache/guacamole/rest/auth/AuthenticationService.java index b6bf5b20e..4fed42aeb 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/auth/AuthenticationService.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/auth/AuthenticationService.java @@ -233,6 +233,7 @@ public class AuthenticationService { private void notifyAuthenticationSuccessListeners( AuthenticatedUser authenticatedUser, GuacamoleSession session) throws GuacamoleException { + UserContext userContext = null; if (session != null) { userContext = session.getUserContext( @@ -258,6 +259,7 @@ public class AuthenticationService { */ private void notifyAuthenticationFailureListeners(Credentials credentials) throws GuacamoleException { + listenerService.authenticationFailed(new AuthenticationFailureEvent(credentials)); } diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/event/ListenerService.java b/guacamole/src/main/java/org/apache/guacamole/rest/event/ListenerService.java index 3b1a00f56..30c4357df 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/event/ListenerService.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/event/ListenerService.java @@ -15,30 +15,26 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * */ package org.apache.guacamole.rest.event; +import java.util.List; import com.google.inject.Inject; import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.extension.ListenerProvider; import org.apache.guacamole.net.event.AuthenticationFailureEvent; import org.apache.guacamole.net.event.AuthenticationSuccessEvent; -import org.apache.guacamole.net.event.TunnelCloseEvent; import org.apache.guacamole.net.event.TunnelConnectEvent; +import org.apache.guacamole.net.event.TunnelCloseEvent; import org.apache.guacamole.net.event.listener.AuthenticationFailureListener; import org.apache.guacamole.net.event.listener.AuthenticationSuccessListener; import org.apache.guacamole.net.event.listener.TunnelCloseListener; import org.apache.guacamole.net.event.listener.TunnelConnectListener; -import java.util.List; - /** * A service used to notify listeners registered by extensions when events of * interest occur. - * - * @author Carl Harris */ public class ListenerService implements ListenerProvider { @@ -50,7 +46,8 @@ public class ListenerService implements ListenerProvider { * are allowed to veto a successful authentication by returning false from the * listener method. Regardless of whether a particular listener rejects the * successful authentication, all listeners are notified. - * @param e + * + * @param event * The AuthenticationSuccessEvent describing the successful authentication * that just occurred. * @@ -62,11 +59,11 @@ public class ListenerService implements ListenerProvider { * some listeners may not receive the authentication success event notification. */ @Override - public boolean authenticationSucceeded(AuthenticationSuccessEvent e) + public boolean authenticationSucceeded(AuthenticationSuccessEvent event) throws GuacamoleException { boolean result = true; for (AuthenticationSuccessListener listener : listeners) { - result = result && listener.authenticationSucceeded(e); + result = result && listener.authenticationSucceeded(event); } return result; } @@ -74,7 +71,7 @@ public class ListenerService implements ListenerProvider { /** * Notifies all bound listeners of an authentication failure event. * - * @param e + * @param event * The AuthenticationSuccessEvent describing the authentication failure * that just occurred. * @@ -83,10 +80,10 @@ public class ListenerService implements ListenerProvider { * some listeners may not receive the authentication failure event notification. */ @Override - public void authenticationFailed(AuthenticationFailureEvent e) + public void authenticationFailed(AuthenticationFailureEvent event) throws GuacamoleException { for (AuthenticationFailureListener listener : listeners) { - listener.authenticationFailed(e); + listener.authenticationFailed(event); } } @@ -95,7 +92,7 @@ public class ListenerService implements ListenerProvider { * are allowed to veto a tunnel connection by returning false from the * listener method. Regardless of whether a particular listener rejects the * tunnel connection, all listeners are notified. - * @param e + * @param event * The TunnelConnectedEvent describing the tunnel that was just connected * * @return @@ -106,11 +103,11 @@ public class ListenerService implements ListenerProvider { * some listeners may not receive the tunnel connected event notification. */ @Override - public boolean tunnelConnected(TunnelConnectEvent e) + public boolean tunnelConnected(TunnelConnectEvent event) throws GuacamoleException { boolean result = true; for (TunnelConnectListener listener : listeners) { - result = result && listener.tunnelConnected(e); + result = result && listener.tunnelConnected(event); } return result; } @@ -120,7 +117,7 @@ public class ListenerService implements ListenerProvider { * are allowed to veto the request to close a tunnel by returning false from * the listener method. Regardless of whether a particular listener rejects the * tunnel close request, all listeners are notified. - * @param e + * @param event * The TunnelCloseEvent describing the tunnel that is to be closed * * @return @@ -131,10 +128,10 @@ public class ListenerService implements ListenerProvider { * some listeners may not receive the tunnel close event notification. */ @Override - public boolean tunnelClosed(TunnelCloseEvent e) throws GuacamoleException { + public boolean tunnelClosed(TunnelCloseEvent event) throws GuacamoleException { boolean result = true; for (TunnelCloseListener listener : listeners) { - result = result && listener.tunnelClosed(e); + result = result && listener.tunnelClosed(event); } return result; }