GUACAMOLE-364: address style consistency issues

This commit is contained in:
Carl Harris
2017-08-17 05:10:32 -04:00
parent 6b6340ac46
commit 059cb75f0f
11 changed files with 30 additions and 38 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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.

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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));
}

View File

@@ -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;
}