Package com.google.gerrit.common.data

Examples of com.google.gerrit.common.data.GroupReference


  @Override
  public GroupReference getValue() {
    String name = suggestBox.getText();
    if (name != null && !name.isEmpty()) {
      return new GroupReference(oracle.getUUID(name), name);
    } else {
      return null;
    }
  }
View Full Code Here


          a.setRequireContactInformation("Y".equals(rs.getString(3)));
          a.setDescription(rs.getString(4));
          a.setAgreementUrl(rs.getString(5));
          if ("Y".equals(rs.getString(6))) {
            a.setAutoVerify(new GroupReference(null, null));
          }
        }
        return agreements;
      } finally {
        rs.close();
View Full Code Here

      }
    } else {
      ag = createGroup(db, name, adminGroupUUIDs.get(0),
          String.format("Users who have accepted the %s CLA", agreement.getName()));
    }
    GroupReference group = config.resolve(ag);
    agreement.setAccepted(Lists.newArrayList(new PermissionRule(group)));
    if (agreement.getAutoVerify() != null) {
      agreement.setAutoVerify(group);
    }
View Full Code Here

          Timestamp acceptedOn = rs.getTimestamp(3);
          minTime = Math.min(minTime, acceptedOn.getTime());

          // Enter Agreement
          GroupReference individualGroup =
              getOrCreateGroupForIndividuals(db, config, adminGroupUUIDs, agreement);
          AccountGroup.Id groupId = db.accountGroups()
              .byUUID(individualGroup.getUUID())
              .toList()
              .get(0)
              .getId();

          final AccountGroupMember.Key key =
View Full Code Here

      ResultSet rs = stmt.executeQuery(
          "SELECT group_uuid, name FROM account_groups WHERE email_only_authors = 'Y'");
      try {
        while (rs.next()) {
          AccountGroup.UUID uuid = new AccountGroup.UUID(rs.getString(1));
          GroupReference group = new GroupReference(uuid, rs.getString(2));
          groups.add(group);
        }
      } finally {
        rs.close();
      }
View Full Code Here

    run(callback, new Action<VoidResult>() {
      public VoidResult run(final ReviewDb db) throws OrmException, Failure {
        final AccountGroup group = db.accountGroups().get(groupId);
        assertAmGroupOwner(db, group);

        GroupReference owner =
            GroupBackends.findExactSuggestion(groupBackend, newOwnerName);
        if (owner == null) {
          throw new Failure(new NoSuchEntityException());
        }

        group.setOwnerGroupUUID(owner.getUUID());
        db.accountGroups().update(Collections.singleton(group));
        groupCache.evict(group);
        return VoidResult.INSTANCE;
      }
    });
View Full Code Here

      AccessSection all = config.getAccessSection(AccessSection.ALL);
      if (all != null) {
        Permission owner = all.getPermission(Permission.OWNER);
        if (owner != null) {
          for (PermissionRule rule : owner.getRules()) {
            GroupReference ref = rule.getGroup();
            if (ref.getUUID() != null) {
              groups.add(ref.getUUID());
            }
          }
        }
      }
      localOwners = Collections.unmodifiableSet(groups);
View Full Code Here

        final AccessSection all =
            config.getAccessSection(AccessSection.ALL, true);
        for (AccountGroup.UUID ownerId : createProjectArgs.ownerIds) {
          GroupDescription.Basic g = groupBackend.get(ownerId);
          if (g != null) {
            GroupReference group = config.resolve(GroupReference.forGroup(g));
            all.getPermission(Permission.OWNER, true).add(
                new PermissionRule(group));
          }
        }
      }
View Full Code Here

  @Override
  public final int parseArguments(final Parameters params)
      throws CmdLineException {
    final String n = params.getParameter(0);
    final GroupReference group = GroupBackends.findBestSuggestion(groupBackend, n);
    if (group == null) {
      throw new CmdLineException(owner, "Group \"" + n + "\" does not exist");
    }
    setter.addValue(group.getUUID());
    return 1;
  }
View Full Code Here

  }

  @Operator
  public Predicate<ChangeData> ownerin(String group)
      throws QueryParseException {
    GroupReference g = GroupBackends.findBestSuggestion(args.groupBackend, group);
    if (g == null) {
      throw error("Group " + group + " not found");
    }
    return new OwnerinPredicate(args.dbProvider, args.userFactory, g.getUUID());
  }
View Full Code Here

TOP

Related Classes of com.google.gerrit.common.data.GroupReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.