Class InternalAccountQuery


  • public class InternalAccountQuery
    extends com.google.gerrit.index.query.InternalQuery<AccountState>
    Query wrapper for the account index.

    Instances are one-time-use. Other singleton classes should inject a Provider rather than holding on to a single instance.

    • Method Detail

      • enforceVisibility

        public InternalAccountQuery enforceVisibility​(boolean enforce)
        Overrides:
        enforceVisibility in class com.google.gerrit.index.query.InternalQuery<AccountState>
      • byDefault

        public List<AccountState> byDefault​(String query)
                                     throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • byExternalId

        public List<AccountState> byExternalId​(String scheme,
                                               String id)
                                        throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • byExternalId

        public List<AccountState> byExternalId​(ExternalId.Key externalId)
                                        throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • oneByExternalId

        public AccountState oneByExternalId​(String externalId)
                                     throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • oneByExternalId

        public AccountState oneByExternalId​(String scheme,
                                            String id)
                                     throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • oneByExternalId

        public AccountState oneByExternalId​(ExternalId.Key externalId)
                                     throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • byFullName

        public List<AccountState> byFullName​(String fullName)
                                      throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • byPreferredEmail

        public List<AccountState> byPreferredEmail​(String email)
                                            throws com.google.gwtorm.server.OrmException
        Queries for accounts that have a preferred email that exactly matches the given email.
        Parameters:
        email - preferred email by which accounts should be found
        Returns:
        list of accounts that have a preferred email that exactly matches the given email
        Throws:
        com.google.gwtorm.server.OrmException - if query cannot be parsed
      • byPreferredEmail

        public com.google.common.collect.Multimap<String,​AccountState> byPreferredEmail​(String... emails)
                                                                                       throws com.google.gwtorm.server.OrmException
        Makes multiple queries for accounts by preferred email (exact match).
        Parameters:
        emails - preferred emails by which accounts should be found
        Returns:
        multimap of the given emails to accounts that have a preferred email that exactly matches this email
        Throws:
        com.google.gwtorm.server.OrmException - if query cannot be parsed
      • byWatchedProject

        public List<AccountState> byWatchedProject​(Project.NameKey project)
                                            throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException