1 /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 package org.springframework.security.userdetails;
17
18 import org.springframework.security.BadCredentialsException;
19
20
21 /**
22 * Thrown if an {@link UserDetailsService} implementation cannot locate a {@link User} by its username.
23 *
24 * @author Ben Alex
25 * @version $Id: UsernameNotFoundException.java 2217 2007-10-27 00:45:30Z luke_t $
26 */
27 public class UsernameNotFoundException extends BadCredentialsException {
28 //~ Constructors ===================================================================================================
29
30 /**
31 * Constructs a <code>UsernameNotFoundException</code> with the specified
32 * message.
33 *
34 * @param msg the detail message.
35 */
36 public UsernameNotFoundException(String msg) {
37 super(msg);
38 }
39
40 /**
41 * Constructs a <code>UsernameNotFoundException</code>, making use of the <tt>extraInformation</tt>
42 * property of the superclass.
43 *
44 * @param msg the detail message
45 * @param extraInformation additional information such as the username.
46 */
47 public UsernameNotFoundException(String msg, Object extraInformation) {
48 super(msg, extraInformation);
49 }
50
51 /**
52 * Constructs a <code>UsernameNotFoundException</code> with the specified
53 * message and root cause.
54 *
55 * @param msg the detail message.
56 * @param t root cause
57 */
58 public UsernameNotFoundException(String msg, Throwable t) {
59 super(msg, t);
60 }
61 }