Class PrincipalServiceManager
- java.lang.Object
-
- net.shibboleth.idp.authn.principal.PrincipalServiceManager
-
public class PrincipalServiceManager extends Object
Manages and exposes instances of thePrincipalService
interface.- Since:
- 4.1.0
-
-
Field Summary
Fields Modifier and Type Field Description private Map<Class<?>,PrincipalService<?>>
classIndexedMap
Service index by class.private Map<String,PrincipalService<?>>
idIndexedMap
Service index by ID.private org.slf4j.Logger
log
Class logger.
-
Constructor Summary
Constructors Constructor Description PrincipalServiceManager(Collection<PrincipalService<?>> services)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<PrincipalService<?>>
all()
Get all of the registered services.<T extends Principal>
PrincipalService<T>byClass(Class<T> claz)
Get aPrincipalService
by type.Principal
principalFromString(String s)
Manufacture aPrincipal
from a string of the format "type/value" where type matches the ID of aPrincipalService
and the value is supplied to a single-arg String constructor if one exists.
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
classIndexedMap
@Nonnull @NonnullElements private final Map<Class<?>,PrincipalService<?>> classIndexedMap
Service index by class.
-
idIndexedMap
@Nonnull @NonnullElements private final Map<String,PrincipalService<?>> idIndexedMap
Service index by ID.
-
-
Constructor Detail
-
PrincipalServiceManager
@Autowired public PrincipalServiceManager(@Nullable @NonnullElements @ParameterName(name="services") Collection<PrincipalService<?>> services)
Constructor.- Parameters:
services
- instances to manage
-
-
Method Detail
-
all
@Nonnull @NonnullElements @NotLive @Unmodifiable public Collection<PrincipalService<?>> all()
Get all of the registered services.- Returns:
- all registered services
-
byClass
@Nullable public <T extends Principal> PrincipalService<T> byClass(@Nonnull Class<T> claz)
Get aPrincipalService
by type.- Type Parameters:
T
- class type- Parameters:
claz
- class type- Returns:
- service for the type, or null
-
principalFromString
@Nullable public Principal principalFromString(@Nonnull @NotEmpty String s)
Manufacture aPrincipal
from a string of the format "type/value" where type matches the ID of aPrincipalService
and the value is supplied to a single-arg String constructor if one exists.- Parameters:
s
- the delimited form above- Returns:
- the new object or null
-
-