From 08f9adb10422771e32c1ed5a99d3bc9f97ec6d44 Mon Sep 17 00:00:00 2001 From: Virtually Nick Date: Mon, 9 Sep 2024 11:14:49 -0400 Subject: [PATCH] GUACAMOLE-1020: Clean up unnecessary Java imports. --- .../restrict/connection/RestrictedConnection.java | 13 +++---------- .../connectiongroup/RestrictedConnectionGroup.java | 9 +-------- .../auth/restrict/form/TimeRestrictionField.java | 2 -- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/connection/RestrictedConnection.java b/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/connection/RestrictedConnection.java index 31f7c33a49..bdbce0bcc4 100644 --- a/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/connection/RestrictedConnection.java +++ b/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/connection/RestrictedConnection.java @@ -19,7 +19,6 @@ package org.apache.guacamole.auth.restrict.connection; -import com.google.inject.Inject; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -41,18 +40,12 @@ * ability to control access to the connection. */ public class RestrictedConnection extends DelegatingConnection implements Restrictable { - + /** * The remote address of the client from which the user logged in. */ private final String remoteAddress; - /** - * The restriction verification service. - */ - @Inject - private RestrictionVerificationService verificationService; - /** * The name of the attribute that contains a list of weekdays and times (UTC) * that this connection can be accessed. The presence of values within this @@ -181,9 +174,9 @@ public void setAttributes(Map attributes) { @Override public GuacamoleTunnel connect(GuacamoleClientInformation info, Map tokens) throws GuacamoleException { - + // Verify the restrictions for this connection. - verificationService.verifyConnectionRestrictions(this, remoteAddress); + RestrictionVerificationService.verifyConnectionRestrictions(this, remoteAddress); // Connect return super.connect(info, tokens); diff --git a/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/connectiongroup/RestrictedConnectionGroup.java b/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/connectiongroup/RestrictedConnectionGroup.java index b877bb51f1..b6c18144ef 100644 --- a/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/connectiongroup/RestrictedConnectionGroup.java +++ b/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/connectiongroup/RestrictedConnectionGroup.java @@ -19,7 +19,6 @@ package org.apache.guacamole.auth.restrict.connectiongroup; -import com.google.inject.Inject; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -47,12 +46,6 @@ public class RestrictedConnectionGroup extends DelegatingConnectionGroup impleme */ private final String remoteAddress; - /** - * The verification service. - */ - @Inject - private RestrictionVerificationService verificationService; - /** * The name of the attribute that contains a list of weekdays and times (UTC) * that this connection group can be accessed. The presence of values within @@ -185,7 +178,7 @@ public GuacamoleTunnel connect(GuacamoleClientInformation info, Map tokens) throws GuacamoleException { // Verify restrictions for this connection group. - verificationService.verifyConnectionRestrictions(this, remoteAddress); + RestrictionVerificationService.verifyConnectionRestrictions(this, remoteAddress); // Connect return super.connect(info, tokens); diff --git a/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/form/TimeRestrictionField.java b/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/form/TimeRestrictionField.java index a3ace4f2c2..e02395302c 100644 --- a/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/form/TimeRestrictionField.java +++ b/extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/form/TimeRestrictionField.java @@ -20,8 +20,6 @@ package org.apache.guacamole.auth.restrict.form; import org.apache.guacamole.form.Field; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * A field that parses a string containing time restrictions into its individual