private ComponentDto loadComponent(DbSession dbSession, Request request) { String componentId = request.getId(); String componentKey = request.getKey(); String branch = request.getBranch(); String pullRequest = request.getPullRequest(); checkArgument(componentId == null || (branch == null && pullRequest == null), "Parameter '%s' cannot be used at the same time as '%s' or '%s'", PARAM_COMPONENT_ID, PARAM_BRANCH, PARAM_PULL_REQUEST); if (branch == null && pullRequest == null) { return componentFinder.getByUuidOrKey(dbSession, componentId, componentKey, COMPONENT_ID_AND_COMPONENT); } checkRequest(componentKey != null, "The '%s' parameter is missing", PARAM_COMPONENT); return componentFinder.getByKeyAndOptionalBranchOrPullRequest(dbSession, componentKey, branch, pullRequest); }
private ComponentDto loadComponent(DbSession dbSession, Request request) { String componentId = request.getId(); String componentKey = request.getKey(); String branch = request.getBranch(); String pullRequest = request.getPullRequest(); checkArgument(componentId == null || (branch == null && pullRequest == null), "Parameter '%s' cannot be used at the same time as '%s' or '%s'", PARAM_COMPONENT_ID, PARAM_BRANCH, PARAM_PULL_REQUEST); if (branch == null && pullRequest == null) { return componentFinder.getByUuidOrKey(dbSession, componentId, componentKey, COMPONENT_ID_AND_COMPONENT); } checkRequest(componentKey!=null, "The '%s' parameter is missing", PARAM_COMPONENT); return componentFinder.getByKeyAndOptionalBranchOrPullRequest(dbSession, componentKey, branch, pullRequest); }
private static Request toShowWsRequest(org.sonar.api.server.ws.Request request) { return new Request() .setId(request.param(PARAM_COMPONENT_ID)) .setKey(request.param(PARAM_COMPONENT)) .setBranch(request.param(PARAM_BRANCH)) .setPullRequest(request.param(PARAM_PULL_REQUEST)); }
private static Request toShowWsRequest(org.sonar.api.server.ws.Request request) { return new Request() .setId(request.param(PARAM_COMPONENT_ID)) .setKey(request.param(PARAM_COMPONENT)) .setBranch(request.param(PARAM_BRANCH)) .setPullRequest(request.param(PARAM_PULL_REQUEST)); }