public class AccountResolver extends Object
The resolve*
methods each define a list of accepted formats for account resolution.
The algorithm for resolving accounts from a list of formats is as follows:
The result never includes accounts that are not visible to the calling user. It also never includes inactive accounts, with a small number of specific exceptions noted in method Javadoc.
Modifier and Type | Class and Description |
---|---|
class |
AccountResolver.Result |
static class |
AccountResolver.UnresolvableAccountException |
Modifier and Type | Method and Description |
---|---|
static String |
exceptionMessage(AccountResolver.Result result) |
static boolean |
isSelf(String input) |
AccountResolver.Result |
resolve(String input)
Resolves all accounts matching the input string.
|
AccountResolver.Result |
resolveByNameOrEmail(String input)
Deprecated.
for use only by MailUtil for parsing commit footers; that class needs to be
reevaluated.
|
public static String exceptionMessage(AccountResolver.Result result)
public static boolean isSelf(String input)
public AccountResolver.Result resolve(String input) throws org.eclipse.jgit.errors.ConfigInvalidException, IOException
The following input formats are recognized:
"self"
and "me"
, if the current user is an IdentifiedUser
. In this case, may return exactly one inactive account.
"18419"
). In this case, may return exactly one inactive
account. This case short-circuits if the input matches.
"Full Name (18419)"
). This
case short-circuits if the input matches.
"username"
).
"Full Name <email@example>"
). This case
short-circuits if the input matches.
"email@example"
. This case short-circuits if the input matches.
Realm.lookup(String)
Realm}.
"Full Name"
).
default search
against the account index.
input
- input string.org.eclipse.jgit.errors.ConfigInvalidException
- if an error occurs.IOException
- if an error occurs.@Deprecated public AccountResolver.Result resolveByNameOrEmail(String input) throws org.eclipse.jgit.errors.ConfigInvalidException, IOException
The following input formats are recognized:
"Full Name <email@example>"
). This case
short-circuits if the input matches.
"email@example"
. This case short-circuits if the input matches.
Realm.lookup(String)
Realm}.
"Full Name"
).
default search
against the account index.
input
- input string.org.eclipse.jgit.errors.ConfigInvalidException
- if an error occurs.IOException
- if an error occurs.