Package com.google.gerrit.server

Examples of com.google.gerrit.server.IdentifiedUser$GenericFactory


      Account.Id accountId = new Account.Id(((IntegerTerm) idTerm).intValue());
      user = cache.get(accountId);
      if (user == null) {
        ReviewDb db = StoredValues.REVIEW_DB.getOrNull(engine);
        IdentifiedUser.GenericFactory userFactory = userFactory(engine);
        IdentifiedUser who;
        if (db != null) {
          who = userFactory.create(Providers.of(db), accountId);
        } else {
          who = userFactory.create(accountId);
        }
View Full Code Here


    event.setProperty(P_SESSION, id(sd.getSessionId()));

    String userName = "-", accountId = "-";

    if (user instanceof IdentifiedUser) {
      IdentifiedUser u = (IdentifiedUser) user;
      userName = u.getAccount().getUserName();
      accountId = "a/" + u.getAccountId().toString();

    } else if (user instanceof PeerDaemonUser) {
      userName = PeerDaemonUser.USER_NAME;

    }
View Full Code Here

  }

  private void verifyProjectVisible(final String type, final Set<Account.Id> who)
      throws UnloggedFailure {
    for (final Account.Id id : who) {
      final IdentifiedUser user = identifiedUserFactory.create(id);
      if (!projectControl.forUser(user).isVisible()) {
        throw new UnloggedFailure(1, type + " "
            + user.getAccount().getFullName() + " cannot access the project");
      }
    }
  }
View Full Code Here

      //
      final PersonIdent tagger = tag.getTaggerIdent();
      if (tagger != null) {
        boolean valid;
        if (getCurrentUser() instanceof IdentifiedUser) {
          final IdentifiedUser user = (IdentifiedUser) getCurrentUser();
          final String addr = tagger.getEmailAddress();
          valid = user.getEmailAddresses().contains(addr);
        } else {
          valid = false;
        }
        if (!valid && !owner && !canForgeCommitter()) {
          return false;
View Full Code Here

          return Collections.emptyList();
        }
        VisibilityControl visibilityControl = new VisibilityControl() {
          @Override
          public boolean isVisible(Account account) throws OrmException {
            IdentifiedUser who =
                identifiedUserFactory.create(reviewDbProvider, account.getId());
            // we can't use changeControl directly as it won't suggest reviewers
            // to drafts
            return changeControl.forUser(who).isRefVisible();
          }
View Full Code Here

      return "";
    }

    final CurrentUser user = sd.getCurrentUser();
    if (user instanceof IdentifiedUser) {
      IdentifiedUser u = (IdentifiedUser) user;

      if (!numeric) {
        String name = u.getUserName();
        if (name != null && !name.isEmpty()) {
          return name;
        }
      }
View Full Code Here

    if (e instanceof UnloggedFailure) {
    } else {
      final StringBuilder m = new StringBuilder();
      m.append("Internal server error");
      if (userProvider.get() instanceof IdentifiedUser) {
        final IdentifiedUser u = (IdentifiedUser) userProvider.get();
        m.append(" (user ");
        m.append(u.getUserName());
        m.append(")");
      }
      m.append(" during ");
      m.append(contextProvider.get().getCommandLine());
      log.error(m.toString(), e);
View Full Code Here

      this.context = contextProvider.get();

      StringBuilder m = new StringBuilder();
      m.append(context.getCommandLine());
      if (userProvider.get() instanceof IdentifiedUser) {
        IdentifiedUser u = (IdentifiedUser) userProvider.get();
        m.append(" (" + u.getUserName() + ")");
      }
      this.taskName = m.toString();
    }
View Full Code Here

    event.setProperty(P_SESSION, id(sd.getSessionId()));

    String userName = "-", accountId = "-";

    if (user instanceof IdentifiedUser) {
      IdentifiedUser u = (IdentifiedUser) user;
      userName = u.getUserName();

    }

    event.setProperty(P_USER_NAME, userName);
    event.setProperty(P_ACCOUNT_ID, accountId);
View Full Code Here

TOP

Related Classes of com.google.gerrit.server.IdentifiedUser$GenericFactory

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.