Interface ResolveUsernameOp
-
- All Superinterfaces:
SPIOperation
public interface ResolveUsernameOp extends SPIOperation
Resolve an object to itsUid
based on its username.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Uid
resolveUsername(ObjectClass objectClass, String username, OperationOptions options)
Resolve an object to itsUid
based on its username.
-
-
-
Method Detail
-
resolveUsername
Uid resolveUsername(ObjectClass objectClass, String username, OperationOptions options)
Resolve an object to itsUid
based on its username. This is a companion to the simpleauthentication
. The difference is that this method does not have a password parameter and does not try to authenticate the credentials; instead, it returns theUid
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
eitherIllegalArgumentException
or if a native exception is available and if its of typeRuntimeException
simple throw it. If the native exception is not aRuntimeException
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
.- Parameters:
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.- Returns:
- Uid The uid of the object corresponding to the username.
- Throws:
RuntimeException
- if the username cannot be resolved. If a native exception is available attempt to throw it.- Since:
- 1.1
-
-