mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-364: address style consistency issues
This commit is contained in:
@@ -15,7 +15,6 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.guacamole;
|
package org.apache.guacamole;
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.guacamole;
|
package org.apache.guacamole;
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.guacamole;
|
package org.apache.guacamole;
|
||||||
|
@@ -28,6 +28,7 @@ import org.apache.guacamole.net.event.AuthenticationFailureEvent;
|
|||||||
* be used to cancel the authentication failure.
|
* be used to cancel the authentication failure.
|
||||||
*/
|
*/
|
||||||
public interface AuthenticationFailureListener extends Listener {
|
public interface AuthenticationFailureListener extends Listener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event hook which fires immediately after a user's authentication attempt
|
* Event hook which fires immediately after a user's authentication attempt
|
||||||
* fails.
|
* fails.
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.guacamole.net.event.listener;
|
package org.apache.guacamole.net.event.listener;
|
||||||
|
@@ -35,7 +35,6 @@ import java.util.Map;
|
|||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipException;
|
import java.util.zip.ZipException;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
import org.apache.guacamole.net.event.listener.Listener;
|
import org.apache.guacamole.net.event.listener.Listener;
|
||||||
import org.codehaus.jackson.JsonParseException;
|
import org.codehaus.jackson.JsonParseException;
|
||||||
import org.codehaus.jackson.map.ObjectMapper;
|
import org.codehaus.jackson.map.ObjectMapper;
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.guacamole.extension;
|
package org.apache.guacamole.extension;
|
||||||
@@ -56,7 +55,7 @@ class ListenerFacade implements ListenerProvider {
|
|||||||
* listener implements the AuthenticationSuccessListener interface.
|
* listener implements the AuthenticationSuccessListener interface.
|
||||||
*
|
*
|
||||||
* @param
|
* @param
|
||||||
* e The AuthenticationSuccessEvent describing the authentication
|
* event The AuthenticationSuccessEvent describing the authentication
|
||||||
* success that just occurred.
|
* success that just occurred.
|
||||||
* @return
|
* @return
|
||||||
* false if the delegate listener rejects the successful authentication,
|
* false if the delegate listener rejects the successful authentication,
|
||||||
@@ -66,10 +65,10 @@ class ListenerFacade implements ListenerProvider {
|
|||||||
* if the delegate listener throws this exception
|
* if the delegate listener throws this exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean authenticationSucceeded(AuthenticationSuccessEvent e)
|
public boolean authenticationSucceeded(AuthenticationSuccessEvent event)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
return !(delegate instanceof AuthenticationSuccessListener)
|
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.
|
* listener implements the AuthenticationSuccessListener interface.
|
||||||
*
|
*
|
||||||
* @param
|
* @param
|
||||||
* e The AuthenticationFailureEvent describing the authentication
|
* event The AuthenticationFailureEvent describing the authentication
|
||||||
* failure that just occurred.
|
* failure that just occurred.
|
||||||
*
|
*
|
||||||
* @throws GuacamoleException
|
* @throws GuacamoleException
|
||||||
* if the delegate listener throws this exception
|
* if the delegate listener throws this exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void authenticationFailed(AuthenticationFailureEvent e)
|
public void authenticationFailed(AuthenticationFailureEvent event)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
if (delegate instanceof AuthenticationFailureListener) {
|
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.
|
* listener implements the TunnelConnectListener interface.
|
||||||
*
|
*
|
||||||
* @param
|
* @param
|
||||||
* e The TunnelConnectEvent describing the tunnel that was just connected
|
* event The TunnelConnectEvent describing the tunnel that was just connected
|
||||||
|
|
||||||
* @return
|
* @return
|
||||||
* false if the delegate listener rejects the tunnel connection,
|
* false if the delegate listener rejects the tunnel connection,
|
||||||
@@ -106,10 +105,10 @@ class ListenerFacade implements ListenerProvider {
|
|||||||
* if the delegate listener throws this exception
|
* if the delegate listener throws this exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean tunnelConnected(TunnelConnectEvent e)
|
public boolean tunnelConnected(TunnelConnectEvent event)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
return !(delegate instanceof TunnelConnectListener)
|
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.
|
* listener implements the TunnelCloseListener interface.
|
||||||
*
|
*
|
||||||
* @param
|
* @param
|
||||||
* e The TunnelCloseEvent describing the tunnel that is to be close
|
* event The TunnelCloseEvent describing the tunnel that is to be close
|
||||||
|
|
||||||
* @return
|
* @return
|
||||||
* false if the delegate listener rejects the tunnel close request,
|
* 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
|
* if the delegate listener throws this exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean tunnelClosed(TunnelCloseEvent e) throws GuacamoleException {
|
public boolean tunnelClosed(TunnelCloseEvent event) throws GuacamoleException {
|
||||||
return !(delegate instanceof TunnelCloseListener)
|
return !(delegate instanceof TunnelCloseListener)
|
||||||
|| ((TunnelCloseListener) delegate).tunnelClosed(e);
|
|| ((TunnelCloseListener) delegate).tunnelClosed(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.guacamole.extension;
|
package org.apache.guacamole.extension;
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.guacamole.extension;
|
package org.apache.guacamole.extension;
|
||||||
|
@@ -233,6 +233,7 @@ public class AuthenticationService {
|
|||||||
private void notifyAuthenticationSuccessListeners(
|
private void notifyAuthenticationSuccessListeners(
|
||||||
AuthenticatedUser authenticatedUser, GuacamoleSession session)
|
AuthenticatedUser authenticatedUser, GuacamoleSession session)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
|
|
||||||
UserContext userContext = null;
|
UserContext userContext = null;
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
userContext = session.getUserContext(
|
userContext = session.getUserContext(
|
||||||
@@ -258,6 +259,7 @@ public class AuthenticationService {
|
|||||||
*/
|
*/
|
||||||
private void notifyAuthenticationFailureListeners(Credentials credentials)
|
private void notifyAuthenticationFailureListeners(Credentials credentials)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
|
|
||||||
listenerService.authenticationFailed(new AuthenticationFailureEvent(credentials));
|
listenerService.authenticationFailed(new AuthenticationFailureEvent(credentials));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,30 +15,26 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.guacamole.rest.event;
|
package org.apache.guacamole.rest.event;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.extension.ListenerProvider;
|
import org.apache.guacamole.extension.ListenerProvider;
|
||||||
import org.apache.guacamole.net.event.AuthenticationFailureEvent;
|
import org.apache.guacamole.net.event.AuthenticationFailureEvent;
|
||||||
import org.apache.guacamole.net.event.AuthenticationSuccessEvent;
|
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.TunnelConnectEvent;
|
||||||
|
import org.apache.guacamole.net.event.TunnelCloseEvent;
|
||||||
import org.apache.guacamole.net.event.listener.AuthenticationFailureListener;
|
import org.apache.guacamole.net.event.listener.AuthenticationFailureListener;
|
||||||
import org.apache.guacamole.net.event.listener.AuthenticationSuccessListener;
|
import org.apache.guacamole.net.event.listener.AuthenticationSuccessListener;
|
||||||
import org.apache.guacamole.net.event.listener.TunnelCloseListener;
|
import org.apache.guacamole.net.event.listener.TunnelCloseListener;
|
||||||
import org.apache.guacamole.net.event.listener.TunnelConnectListener;
|
import org.apache.guacamole.net.event.listener.TunnelConnectListener;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service used to notify listeners registered by extensions when events of
|
* A service used to notify listeners registered by extensions when events of
|
||||||
* interest occur.
|
* interest occur.
|
||||||
*
|
|
||||||
* @author Carl Harris
|
|
||||||
*/
|
*/
|
||||||
public class ListenerService implements ListenerProvider {
|
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
|
* are allowed to veto a successful authentication by returning false from the
|
||||||
* listener method. Regardless of whether a particular listener rejects the
|
* listener method. Regardless of whether a particular listener rejects the
|
||||||
* successful authentication, all listeners are notified.
|
* successful authentication, all listeners are notified.
|
||||||
* @param e
|
*
|
||||||
|
* @param event
|
||||||
* The AuthenticationSuccessEvent describing the successful authentication
|
* The AuthenticationSuccessEvent describing the successful authentication
|
||||||
* that just occurred.
|
* that just occurred.
|
||||||
*
|
*
|
||||||
@@ -62,11 +59,11 @@ public class ListenerService implements ListenerProvider {
|
|||||||
* some listeners may not receive the authentication success event notification.
|
* some listeners may not receive the authentication success event notification.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean authenticationSucceeded(AuthenticationSuccessEvent e)
|
public boolean authenticationSucceeded(AuthenticationSuccessEvent event)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
for (AuthenticationSuccessListener listener : listeners) {
|
for (AuthenticationSuccessListener listener : listeners) {
|
||||||
result = result && listener.authenticationSucceeded(e);
|
result = result && listener.authenticationSucceeded(event);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -74,7 +71,7 @@ public class ListenerService implements ListenerProvider {
|
|||||||
/**
|
/**
|
||||||
* Notifies all bound listeners of an authentication failure event.
|
* Notifies all bound listeners of an authentication failure event.
|
||||||
*
|
*
|
||||||
* @param e
|
* @param event
|
||||||
* The AuthenticationSuccessEvent describing the authentication failure
|
* The AuthenticationSuccessEvent describing the authentication failure
|
||||||
* that just occurred.
|
* that just occurred.
|
||||||
*
|
*
|
||||||
@@ -83,10 +80,10 @@ public class ListenerService implements ListenerProvider {
|
|||||||
* some listeners may not receive the authentication failure event notification.
|
* some listeners may not receive the authentication failure event notification.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void authenticationFailed(AuthenticationFailureEvent e)
|
public void authenticationFailed(AuthenticationFailureEvent event)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
for (AuthenticationFailureListener listener : listeners) {
|
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
|
* are allowed to veto a tunnel connection by returning false from the
|
||||||
* listener method. Regardless of whether a particular listener rejects the
|
* listener method. Regardless of whether a particular listener rejects the
|
||||||
* tunnel connection, all listeners are notified.
|
* tunnel connection, all listeners are notified.
|
||||||
* @param e
|
* @param event
|
||||||
* The TunnelConnectedEvent describing the tunnel that was just connected
|
* The TunnelConnectedEvent describing the tunnel that was just connected
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@@ -106,11 +103,11 @@ public class ListenerService implements ListenerProvider {
|
|||||||
* some listeners may not receive the tunnel connected event notification.
|
* some listeners may not receive the tunnel connected event notification.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean tunnelConnected(TunnelConnectEvent e)
|
public boolean tunnelConnected(TunnelConnectEvent event)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
for (TunnelConnectListener listener : listeners) {
|
for (TunnelConnectListener listener : listeners) {
|
||||||
result = result && listener.tunnelConnected(e);
|
result = result && listener.tunnelConnected(event);
|
||||||
}
|
}
|
||||||
return result;
|
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
|
* 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
|
* the listener method. Regardless of whether a particular listener rejects the
|
||||||
* tunnel close request, all listeners are notified.
|
* tunnel close request, all listeners are notified.
|
||||||
* @param e
|
* @param event
|
||||||
* The TunnelCloseEvent describing the tunnel that is to be closed
|
* The TunnelCloseEvent describing the tunnel that is to be closed
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@@ -131,10 +128,10 @@ public class ListenerService implements ListenerProvider {
|
|||||||
* some listeners may not receive the tunnel close event notification.
|
* some listeners may not receive the tunnel close event notification.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean tunnelClosed(TunnelCloseEvent e) throws GuacamoleException {
|
public boolean tunnelClosed(TunnelCloseEvent event) throws GuacamoleException {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
for (TunnelCloseListener listener : listeners) {
|
for (TunnelCloseListener listener : listeners) {
|
||||||
result = result && listener.tunnelClosed(e);
|
result = result && listener.tunnelClosed(event);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user