Skip navigation links

Interface ResolveUsernameOp

All Superinterfaces:

public interface ResolveUsernameOp
extends SPIOperation

Resolve an object to its Uid based on its username.

Method Summary
 Uid resolveUsername(ObjectClass objectClass, java.lang.String username, OperationOptions options)
          Resolve an object to its Uid based on its username.


Method Detail


Uid resolveUsername(ObjectClass objectClass,
                    java.lang.String username,
                    OperationOptions options)
Resolve an object to its 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.
Uid The uid of the object corresponding to the username.
java.lang.RuntimeException - iff the username cannot be resolved. If a native exception is available attempt to throw it.

Skip navigation links

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.