Examples of accountExternalIds()


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

    manager.start();
    dbInjector.injectMembers(this);

    final ReviewDb db = database.open();
    try {
      todo = db.accountExternalIds().all().toList();
      synchronized (monitor) {
        monitor.beginTask("Converting local username", todo.size());
      }
    } finally {
      db.close();
View Full Code Here

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

      final ReviewDb db = schema.open();
      try {
        who = realm.unlink(db, from, who);

        final AccountExternalId.Key key = id(who);
        AccountExternalId extId = db.accountExternalIds().get(key);
        if (extId != null) {
          if (!extId.getAccountId().equals(from)) {
            throw new AccountException("Identity in use by another account");
          }
          db.accountExternalIds().delete(Collections.singleton(extId));
View Full Code Here

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

        AccountExternalId extId = db.accountExternalIds().get(key);
        if (extId != null) {
          if (!extId.getAccountId().equals(from)) {
            throw new AccountException("Identity in use by another account");
          }
          db.accountExternalIds().delete(Collections.singleton(extId));

          if (who.getEmailAddress() != null) {
            final Account a = db.accounts().get(from);
            if (a.getPreferredEmail() != null
                && a.getPreferredEmail().equals(who.getEmailAddress())) {
View Full Code Here

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

      final ReviewDb db = schema.open();
      try {
        final AccountExternalId.Key key = new AccountExternalId.Key( //
            AccountExternalId.SCHEME_USERNAME, //
            username);
        final AccountExternalId id = db.accountExternalIds().get(key);
        if (id != null) {
          return Optional.of(id.getAccountId());
        }
        return Optional.absent();
      } finally {
View Full Code Here

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

      try {
        Set<Account.Id> r = Sets.newHashSet();
        for (Account a : db.accounts().byPreferredEmail(email)) {
          r.add(a.getId());
        }
        for (AccountExternalId a : db.accountExternalIds()
            .byEmailAddress(email)) {
          r.add(a.getAccountId());
        }
        return ImmutableSet.copyOf(r);
      } finally {
View Full Code Here

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

    field(b, "Preferred-Email", account.getPreferredEmail());

    try {
      final ReviewDb db = schema.open();
      try {
        for (final AccountExternalId e : db.accountExternalIds().byAccount(
            account.getId())) {
          final StringBuilder oistr = new StringBuilder();
          if (e.getEmailAddress() != null && e.getEmailAddress().length() > 0) {
            if (oistr.length() > 0) {
              oistr.append(' ');
View Full Code Here

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

    try {
      final ReviewDb db = schema.open();
      try {
        AccountExternalId.Key key =
            new AccountExternalId.Key(SCHEME_USERNAME, userName);
        return auth(db.accountExternalIds().get(key));
      } finally {
        db.close();
      }
    } catch (OrmException e) {
      getServletContext().log("cannot query database", e);
View Full Code Here

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

  public Account.Id lookup(final String externalId) throws AccountException {
    try {
      final ReviewDb db = schema.open();
      try {
        final AccountExternalId ext =
            db.accountExternalIds().get(new AccountExternalId.Key(externalId));
        return ext != null ? ext.getAccountId() : null;
      } finally {
        db.close();
      }
    } catch (OrmException e) {
View Full Code Here

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

    who = realm.authenticate(who);
    try {
      final ReviewDb db = schema.open();
      try {
        final AccountExternalId.Key key = id(who);
        final AccountExternalId id = db.accountExternalIds().get(key);
        if (id == null) {
          // New account, automatically create and return.
          //
          return create(db, who);
View Full Code Here

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

      final ReviewDb db = schema.open();
      try {
        who = realm.link(db, to, who);

        final AccountExternalId.Key key = id(who);
        AccountExternalId extId = db.accountExternalIds().get(key);
        if (extId != null) {
          if (!extId.getAccountId().equals(to)) {
            throw new AccountException("Identity in use by another account");
          }
          update(db, who, extId);
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.