public interface ResolveUsernameOp extends SPIOperation
Uid
based on its username.Modifier and Type | Method and Description |
---|---|
Uid |
resolveUsername(ObjectClass objectClass,
String username,
OperationOptions options)
Resolve an object to its
Uid based on its username. |
Uid resolveUsername(ObjectClass objectClass, String username, OperationOptions options)
Uid
based on its username.
This is a companion to the simple authentication
.
The difference is that this method does not have a password parameter and
does not try to authenticate the credentials; instead, it
returns the Uid
corresponding to the username.
Implementations method must, however, validate the username (i.e., they must throw
and exception if the username does not correspond to an existing object).
If the username validation fails, the
developer should throw a type of RuntimeException
either
IllegalArgumentException
or if a native exception is available
and if its of type RuntimeException
simple throw it. If the
native exception is not a RuntimeException
wrap it in one and
throw it. This will provide the most detail for logging problem and
failed attempts.
The developer is of course encourage to try and throw the most
informative exception as possible. In that regards there are several
exceptions provided in the exceptions package. For instance one of the
most common is UnknownUidException
.
objectClass
- The object class to resolve the username for.
Will typically be an account. Will not be null.username
- the username to resolve. Will not be null.options
- additional options that impact the way this operation is run.
If the caller passes null, the framework will convert this into
an empty set of options, so SPI need not worry
about this ever being null.RuntimeException
- iff the username cannot be resolved. If a native exception is
available attempt to throw it.Copyright © 2013. All Rights Reserved.