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 @Override
public Object getResource() throws GuacamoleException { public Object getResource() throws GuacamoleException {
return new QuickConnectREST(this); return new QuickConnectREST(connectionDirectory);
} }
@Override @Override

View File

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