mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUAC-1105: Throw GuacamoleClientTooManyException if connection group usage is denied due to duplicate use.
This commit is contained in:
@@ -29,6 +29,7 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.glyptodon.guacamole.GuacamoleClientTooManyException;
|
||||
import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
|
||||
import org.glyptodon.guacamole.auth.jdbc.connection.ModeledConnection;
|
||||
import org.glyptodon.guacamole.GuacamoleException;
|
||||
@@ -102,7 +103,7 @@ public class MultiseatGuacamoleSocketService
|
||||
// Do not allow duplicate use of connection groups
|
||||
Seat seat = new Seat(user.getUser().getIdentifier(), connectionGroup.getIdentifier());
|
||||
if (!activeGroupSeats.add(seat))
|
||||
throw new GuacamoleResourceConflictException("Cannot connect. This connection is in use.");
|
||||
throw new GuacamoleClientTooManyException("Cannot connect. Connection group already in use by this user.");
|
||||
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.glyptodon.guacamole.GuacamoleClientTooManyException;
|
||||
import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser;
|
||||
import org.glyptodon.guacamole.auth.jdbc.connection.ModeledConnection;
|
||||
import org.glyptodon.guacamole.GuacamoleException;
|
||||
@@ -85,7 +86,7 @@ public class SingleSeatGuacamoleSocketService
|
||||
// Do not allow duplicate use of connection groups
|
||||
Seat seat = new Seat(user.getUser().getIdentifier(), connectionGroup.getIdentifier());
|
||||
if (!activeGroupSeats.add(seat))
|
||||
throw new GuacamoleResourceConflictException("Cannot connect. This connection is in use.");
|
||||
throw new GuacamoleClientTooManyException("Cannot connect. Connection group already in use by this user.");
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user