Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 59060200B68 for ; Wed, 13 Jul 2016 07:09:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 57CB4160A87; Wed, 13 Jul 2016 05:09:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6D278160A89 for ; Wed, 13 Jul 2016 07:09:44 +0200 (CEST) Received: (qmail 1921 invoked by uid 500); 13 Jul 2016 05:09:43 -0000 Mailing-List: contact commits-help@guacamole.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@guacamole.incubator.apache.org Delivered-To: mailing list commits@guacamole.incubator.apache.org Received: (qmail 1903 invoked by uid 99); 13 Jul 2016 05:09:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2016 05:09:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E07DDC0B9A for ; Wed, 13 Jul 2016 05:09:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id jxakFa0UooQ8 for ; Wed, 13 Jul 2016 05:09:41 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id B86275FCE5 for ; Wed, 13 Jul 2016 05:09:40 +0000 (UTC) Received: (qmail 1675 invoked by uid 99); 13 Jul 2016 05:09:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2016 05:09:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D0A33E78B1; Wed, 13 Jul 2016 05:09:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jmuehlner@apache.org To: commits@guacamole.incubator.apache.org Date: Wed, 13 Jul 2016 05:09:54 -0000 Message-Id: <128c07b2a6af4299b5b5e9f196ecbddf@git.apache.org> In-Reply-To: <5aa4dc1453cf4cb8919d52480ff0aa25@git.apache.org> References: <5aa4dc1453cf4cb8919d52480ff0aa25@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [16/24] incubator-guacamole-client git commit: GUACAMOLE-5: Remove unneeded functions from ObjectRetrievalService. archived-at: Wed, 13 Jul 2016 05:09:45 -0000 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 Authored: Tue Jul 12 14:12:11 2016 -0700 Committer: Michael Jumper 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 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 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 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); - - } - }