Package hudson.model
Class User.CanonicalIdResolver
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<User.CanonicalIdResolver>
-
- hudson.model.User.CanonicalIdResolver
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<User.CanonicalIdResolver>
,Comparable<User.CanonicalIdResolver>
- Direct Known Subclasses:
DefaultUserCanonicalIdResolver
,User.FullNameIdResolver
,User.UserIDCanonicalIdResolver
- Enclosing class:
- User
public abstract static class User.CanonicalIdResolver extends AbstractDescribableImpl<User.CanonicalIdResolver> implements ExtensionPoint, Comparable<User.CanonicalIdResolver>
Resolves User IDs by ID, full names or other strings.This extension point may be useful to map SCM user names to Jenkins
User
IDs. Currently the extension point is used inUser.get(String, boolean, Map)
.- Since:
- 1.479
- See Also:
DefaultUserCanonicalIdResolver
,User.FullNameIdResolver
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description CanonicalIdResolver()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static List<User.CanonicalIdResolver>
all()
Gets all extension points, sorted by priority.int
compareTo(User.CanonicalIdResolver o)
int
getPriority()
Gets priority of the resolver.static String
resolve(String idOrFullName, Map<String,?> context)
Resolves users using all availableUser.CanonicalIdResolver
s.abstract String
resolveCanonicalId(String idOrFullName, Map<String,?> context)
extract user ID from idOrFullName with help from contextual infos.-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Field Detail
-
REALM
public static final String REALM
context key for realm (domain) where idOrFullName has been retrieved from. Can be used (for example) to distinguish ambiguous committer ID using the SCM URL. Associated Value is aString
- See Also:
- Constant Field Values
-
-
Method Detail
-
compareTo
public int compareTo(@NonNull User.CanonicalIdResolver o)
- Specified by:
compareTo
in interfaceComparable<User.CanonicalIdResolver>
-
resolveCanonicalId
@CheckForNull public abstract String resolveCanonicalId(String idOrFullName, Map<String,?> context)
extract user ID from idOrFullName with help from contextual infos. can returnnull
if no user ID matched the input
-
getPriority
public int getPriority()
Gets priority of the resolver. Higher priority means that it will be checked earlier.Overriding methods must not use
Integer.MIN_VALUE
, because it will cause collisions withDefaultUserCanonicalIdResolver
.- Returns:
- Priority of the resolver.
-
all
public static List<User.CanonicalIdResolver> all()
Gets all extension points, sorted by priority.- Returns:
- Sorted list of extension point implementations.
- Since:
- 2.93
-
resolve
@CheckForNull public static String resolve(@NonNull String idOrFullName, @NonNull Map<String,?> context)
Resolves users using all availableUser.CanonicalIdResolver
s.- Parameters:
idOrFullName
- ID or full name of the usercontext
- Context- Returns:
- Resolved User ID or
null
if the user ID cannot be resolved. - Since:
- 2.93
-
-