Uid resolveUsername(ObjectClass objectClass, String username, OperationOptions options)
Uidbased 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
Uidcorresponding 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
IllegalArgumentException or if a
native exception is available and if its of type
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
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- if the username cannot be resolved. If a native exception is available attempt to throw it.
Copyright © 2017. All rights reserved.