GUACAMOLE-364: address style consistency issues
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/059cb75f Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/059cb75f Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/059cb75f Branch: refs/heads/master Commit: 059cb75f0fd47b8a4c02491710e83695f26456bf Parents: 6b6340a Author: Carl Harris <[email protected]> Authored: Thu Aug 17 05:10:32 2017 -0400 Committer: Carl Harris <[email protected]> Committed: Thu Aug 17 05:11:54 2017 -0400 ---------------------------------------------------------------------- ...uacamoleAuthenticationRejectedException.java | 1 - .../GuacamoleTunnelConnectedException.java | 1 - .../GuacamoleTunnelRejectedException.java | 1 - .../listener/AuthenticationFailureListener.java | 1 + .../guacamole/net/event/listener/Listener.java | 1 - .../apache/guacamole/extension/Extension.java | 1 - .../guacamole/extension/ListenerFacade.java | 25 +++++++-------- .../guacamole/extension/ListenerProvider.java | 1 - .../guacamole/extension/ProviderFactory.java | 1 - .../rest/auth/AuthenticationService.java | 2 ++ .../guacamole/rest/event/ListenerService.java | 33 +++++++++----------- 11 files changed, 30 insertions(+), 38 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleAuthenticationRejectedException.java ---------------------------------------------------------------------- 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 7d7bfa8..907e0c9 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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelConnectedException.java ---------------------------------------------------------------------- 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 96693a4..c7d21cf 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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole-common/src/main/java/org/apache/guacamole/GuacamoleTunnelRejectedException.java ---------------------------------------------------------------------- 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 c2e09f9..b9367c1 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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/AuthenticationFailureListener.java ---------------------------------------------------------------------- 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 7fa6190..86122ba 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. http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole-ext/src/main/java/org/apache/guacamole/net/event/listener/Listener.java ---------------------------------------------------------------------- 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 72f859d..5849993 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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole/src/main/java/org/apache/guacamole/extension/Extension.java ---------------------------------------------------------------------- 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 ac58676..697002d 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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole/src/main/java/org/apache/guacamole/extension/ListenerFacade.java ---------------------------------------------------------------------- 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 278b2a9..ab0b7c8 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); } } http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole/src/main/java/org/apache/guacamole/extension/ListenerProvider.java ---------------------------------------------------------------------- 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 0b3a747..1d8afc1 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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole/src/main/java/org/apache/guacamole/extension/ProviderFactory.java ---------------------------------------------------------------------- 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 0620b4d..376b213 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; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole/src/main/java/org/apache/guacamole/rest/auth/AuthenticationService.java ---------------------------------------------------------------------- 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 b6bf5b2..4fed42a 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)); } http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/059cb75f/guacamole/src/main/java/org/apache/guacamole/rest/event/ListenerService.java ---------------------------------------------------------------------- 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 3b1a00f..30c4357 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; }
