Examples of accountGroups()


Examples of com.google.gerrit.reviewdb.server.ReviewDb.accountGroups()

  @Override
  public Iterable<AccountGroup> all() {
    try {
      ReviewDb db = schema.open();
      try {
        return Collections.unmodifiableList(db.accountGroups().all().toList());
      } finally {
        db.close();
      }
    } catch (OrmException e) {
      log.warn("Cannot list internal groups", e);
View Full Code Here

Examples of com.google.gerrit.reviewdb.server.ReviewDb.accountGroups()

    @Override
    public Optional<AccountGroup> load(final AccountGroup.Id key)
        throws Exception {
      final ReviewDb db = schema.open();
      try {
        return Optional.fromNullable(db.accountGroups().get(key));
      } finally {
        db.close();
      }
    }
  }
View Full Code Here

Examples of com.google.gerrit.reviewdb.server.ReviewDb.accountGroups()

      final ReviewDb db = schema.open();
      try {
        AccountGroup.NameKey key = new AccountGroup.NameKey(name);
        AccountGroupName r = db.accountGroupNames().get(key);
        if (r != null) {
          return Optional.fromNullable(db.accountGroups().get(r.getId()));
        }
        return Optional.absent();
      } finally {
        db.close();
      }
View Full Code Here

Examples of com.google.gerrit.reviewdb.server.ReviewDb.accountGroups()

        throws Exception {
      final ReviewDb db = schema.open();
      try {
        List<AccountGroup> r;

        r = db.accountGroups().byUUID(new AccountGroup.UUID(uuid)).toList();
        if (r.size() == 1) {
          return Optional.of(r.get(0));
        } else if (r.size() == 0) {
          return Optional.absent();
        } else {
View Full Code Here

Examples of com.google.gerrit.reviewdb.server.ReviewDb.accountGroups()

    @Override
    public Set<AccountGroup.UUID> load(AccountGroup.UUID key) throws Exception {
      final ReviewDb db = schema.open();
      try {
        List<AccountGroup> group = db.accountGroups().byUUID(key).toList();
        if (group.size() != 1) {
          return Collections.emptySet();
        }

        Set<AccountGroup.Id> ids = Sets.newHashSet();
View Full Code Here

Examples of com.google.gerrit.reviewdb.server.ReviewDb.accountGroups()

            .byInclude(group.get(0).getId())) {
          ids.add(agi.getGroupId());
        }

        Set<AccountGroup.UUID> groupArray = Sets.newHashSet();
        for (AccountGroup g : db.accountGroups().get(ids)) {
          groupArray.add(g.getGroupUUID());
        }
        return ImmutableSet.copyOf(groupArray);
      } finally {
        db.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.