GUACAMOLE-38: REST class only needs directory, not entire userContext object.

This commit is contained in:
Nick Couchman
2018-04-19 06:29:06 -04:00
parent 963593ea27
commit d9751f20d0
2 changed files with 5 additions and 12 deletions

View File

@@ -114,7 +114,7 @@ public class QuickConnectUserContext extends AbstractUserContext {
@Override
public Object getResource() throws GuacamoleException {
return new QuickConnectREST(this);
return new QuickConnectREST(connectionDirectory);
}
@Override

View File

@@ -26,7 +26,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.auth.quickconnect.QuickConnectDirectory;
import org.apache.guacamole.auth.quickconnect.QuickConnectUserContext;
import org.apache.guacamole.auth.quickconnect.utility.QCParser;
/**
@@ -41,26 +40,20 @@ public class QuickConnectREST {
*/
private QuickConnectDirectory directory;
/**
* The UserContext object for this REST endpoint.
*/
private QuickConnectUserContext userContext;
/**
* Construct a new QuickConnectREST class, taking in the UserContext
* object that calls this constructor.
*
* @param userContext
* The UserContext object associated with this REST endpoint
* @param directory
* The ConnectionDirectory object associated with this REST endpoint
*
* @throws GuacamoleException
* If the UserContext is unavailable or the directory object
* cannot be retrieved.
*/
public QuickConnectREST(QuickConnectUserContext userContext)
public QuickConnectREST(QuickConnectDirectory directory)
throws GuacamoleException {
this.userContext = userContext;
this.directory = this.userContext.getConnectionDirectory();
this.directory = directory;
}
/**