guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [16/24] incubator-guacamole-client git commit: GUACAMOLE-5: Remove unneeded functions from ObjectRetrievalService.
Date Wed, 13 Jul 2016 05:09:54 GMT
GUACAMOLE-5: Remove unneeded functions from ObjectRetrievalService.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/50295083
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/50295083
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/50295083

Branch: refs/heads/master
Commit: 50295083d2f3e23a25c8c98097dbca255936ff65
Parents: 3c9da92
Author: Michael Jumper <mjumper@apache.org>
Authored: Tue Jul 12 14:12:11 2016 -0700
Committer: Michael Jumper <mjumper@apache.org>
Committed: Tue Jul 12 21:23:47 2016 -0700

----------------------------------------------------------------------
 .../guacamole/rest/ObjectRetrievalService.java  | 202 +------------------
 1 file changed, 1 insertion(+), 201 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/50295083/guacamole/src/main/java/org/apache/guacamole/rest/ObjectRetrievalService.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/ObjectRetrievalService.java
b/guacamole/src/main/java/org/apache/guacamole/rest/ObjectRetrievalService.java
index d0e403c..edcb2fa 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/ObjectRetrievalService.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/ObjectRetrievalService.java
@@ -23,19 +23,11 @@ import java.util.List;
 import org.apache.guacamole.GuacamoleException;
 import org.apache.guacamole.GuacamoleResourceNotFoundException;
 import org.apache.guacamole.net.auth.AuthenticationProvider;
-import org.apache.guacamole.net.auth.Connection;
-import org.apache.guacamole.net.auth.ConnectionGroup;
-import org.apache.guacamole.net.auth.Directory;
-import org.apache.guacamole.net.auth.User;
 import org.apache.guacamole.net.auth.UserContext;
 import org.apache.guacamole.GuacamoleSession;
-import org.apache.guacamole.rest.connectiongroup.APIConnectionGroup;
 
 /**
- * Provides easy access and automatic error handling for retrieval of objects,
- * such as users, connections, or connection groups. REST API semantics, such
- * as the special root connection group identifier, are also handled
- * automatically.
+ * Provides easy access and automatic error handling for retrieval of objects.
  */
 public class ObjectRetrievalService {
 
@@ -82,196 +74,4 @@ public class ObjectRetrievalService {
 
     }
 
-    /**
-     * Retrieves a single user from the given user context.
-     *
-     * @param userContext
-     *     The user context to retrieve the user from.
-     *
-     * @param identifier
-     *     The identifier of the user to retrieve.
-     *
-     * @return
-     *     The user having the given identifier.
-     *
-     * @throws GuacamoleException 
-     *     If an error occurs while retrieving the user, or if the
-     *     user does not exist.
-     */
-    public User retrieveUser(UserContext userContext,
-            String identifier) throws GuacamoleException {
-
-        // Get user directory
-        Directory<User> directory = userContext.getUserDirectory();
-
-        // Pull specified user
-        User user = directory.get(identifier);
-        if (user == null)
-            throw new GuacamoleResourceNotFoundException("No such user: \"" + identifier
+ "\"");
-
-        return user;
-
-    }
-
-    /**
-     * Retrieves a single user from the given GuacamoleSession.
-     *
-     * @param session
-     *     The GuacamoleSession to retrieve the user from.
-     *
-     * @param authProviderIdentifier
-     *     The unique identifier of the AuthenticationProvider that created the
-     *     UserContext from which the user should be retrieved. Only one
-     *     UserContext per User per AuthenticationProvider can exist.
-     *
-     * @param identifier
-     *     The identifier of the user to retrieve.
-     *
-     * @return
-     *     The user having the given identifier.
-     *
-     * @throws GuacamoleException 
-     *     If an error occurs while retrieving the user, or if the
-     *     user does not exist.
-     */
-    public User retrieveUser(GuacamoleSession session, String authProviderIdentifier,
-            String identifier) throws GuacamoleException {
-
-        UserContext userContext = retrieveUserContext(session, authProviderIdentifier);
-        return retrieveUser(userContext, identifier);
-
-    }
-
-    /**
-     * Retrieves a single connection from the given user context.
-     *
-     * @param userContext
-     *     The user context to retrieve the connection from.
-     *
-     * @param identifier
-     *     The identifier of the connection to retrieve.
-     *
-     * @return
-     *     The connection having the given identifier.
-     *
-     * @throws GuacamoleException 
-     *     If an error occurs while retrieving the connection, or if the
-     *     connection does not exist.
-     */
-    public Connection retrieveConnection(UserContext userContext,
-            String identifier) throws GuacamoleException {
-
-        // Get connection directory
-        Directory<Connection> directory = userContext.getConnectionDirectory();
-
-        // Pull specified connection
-        Connection connection = directory.get(identifier);
-        if (connection == null)
-            throw new GuacamoleResourceNotFoundException("No such connection: \"" + identifier
+ "\"");
-
-        return connection;
-
-    }
-
-    /**
-     * Retrieves a single connection from the given GuacamoleSession.
-     *
-     * @param session
-     *     The GuacamoleSession to retrieve the connection from.
-     *
-     * @param authProviderIdentifier
-     *     The unique identifier of the AuthenticationProvider that created the
-     *     UserContext from which the connection should be retrieved. Only one
-     *     UserContext per User per AuthenticationProvider can exist.
-     *
-     * @param identifier
-     *     The identifier of the connection to retrieve.
-     *
-     * @return
-     *     The connection having the given identifier.
-     *
-     * @throws GuacamoleException 
-     *     If an error occurs while retrieving the connection, or if the
-     *     connection does not exist.
-     */
-    public Connection retrieveConnection(GuacamoleSession session,
-            String authProviderIdentifier, String identifier)
-            throws GuacamoleException {
-
-        UserContext userContext = retrieveUserContext(session, authProviderIdentifier);
-        return retrieveConnection(userContext, identifier);
-
-    }
-
-    /**
-     * Retrieves a single connection group from the given user context. If
-     * the given identifier the REST API root identifier, the root connection
-     * group will be returned. The underlying authentication provider may
-     * additionally use a different identifier for root.
-     *
-     * @param userContext
-     *     The user context to retrieve the connection group from.
-     *
-     * @param identifier
-     *     The identifier of the connection group to retrieve.
-     *
-     * @return
-     *     The connection group having the given identifier, or the root
-     *     connection group if the identifier the root identifier.
-     *
-     * @throws GuacamoleException 
-     *     If an error occurs while retrieving the connection group, or if the
-     *     connection group does not exist.
-     */
-    public ConnectionGroup retrieveConnectionGroup(UserContext userContext,
-            String identifier) throws GuacamoleException {
-
-        // Use root group if identifier is the standard root identifier
-        if (identifier != null && identifier.equals(APIConnectionGroup.ROOT_IDENTIFIER))
-            return userContext.getRootConnectionGroup();
-
-        // Pull specified connection group otherwise
-        Directory<ConnectionGroup> directory = userContext.getConnectionGroupDirectory();
-        ConnectionGroup connectionGroup = directory.get(identifier);
-
-        if (connectionGroup == null)
-            throw new GuacamoleResourceNotFoundException("No such connection group: \"" +
identifier + "\"");
-
-        return connectionGroup;
-
-    }
-
-    /**
-     * Retrieves a single connection group from the given GuacamoleSession. If
-     * the given identifier is the REST API root identifier, the root
-     * connection group will be returned. The underlying authentication
-     * provider may additionally use a different identifier for root.
-     *
-     * @param session
-     *     The GuacamoleSession to retrieve the connection group from.
-     *
-     * @param authProviderIdentifier
-     *     The unique identifier of the AuthenticationProvider that created the
-     *     UserContext from which the connection group should be retrieved.
-     *     Only one UserContext per User per AuthenticationProvider can exist.
-     *
-     * @param identifier
-     *     The identifier of the connection group to retrieve.
-     *
-     * @return
-     *     The connection group having the given identifier, or the root
-     *     connection group if the identifier is the root identifier.
-     *
-     * @throws GuacamoleException 
-     *     If an error occurs while retrieving the connection group, or if the
-     *     connection group does not exist.
-     */
-    public ConnectionGroup retrieveConnectionGroup(GuacamoleSession session,
-            String authProviderIdentifier, String identifier) throws GuacamoleException {
-
-        UserContext userContext = retrieveUserContext(session, authProviderIdentifier);
-        return retrieveConnectionGroup(userContext, identifier);
-
-    }
-
 }


Mime
View raw message