author | darcy |
Thu, 29 Aug 2019 10:52:21 -0700 | |
changeset 57950 | 4612a3cfb927 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
6517 | 1 |
/* |
57950
4612a3cfb927
8229999: Apply java.io.Serial annotations to security types in java.base
darcy
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. |
6517 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package com.sun.security.ntlm; |
|
27 |
||
28 |
import java.security.GeneralSecurityException; |
|
29 |
||
30 |
/** |
|
31 |
* An NTLM-related Exception |
|
32 |
*/ |
|
33 |
public final class NTLMException extends GeneralSecurityException { |
|
57950
4612a3cfb927
8229999: Apply java.io.Serial annotations to security types in java.base
darcy
parents:
47216
diff
changeset
|
34 |
@java.io.Serial |
10336
0bb1999251f8
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents:
6517
diff
changeset
|
35 |
private static final long serialVersionUID = -3298539507906689430L; |
6517 | 36 |
|
37 |
/** |
|
38 |
* If the incoming packet is invalid. |
|
39 |
*/ |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
40 |
public static final int PACKET_READ_ERROR = 1; |
6517 | 41 |
|
42 |
/** |
|
43 |
* If the client cannot get a domain value from the server and the |
|
44 |
* caller has not provided one. |
|
45 |
*/ |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
46 |
public static final int NO_DOMAIN_INFO = 2; |
6517 | 47 |
|
48 |
/** |
|
49 |
* If the domain provided by the client does not match the one received |
|
50 |
* from server. |
|
51 |
*/ |
|
52 |
//public final static int DOMAIN_UNMATCH = 3; |
|
53 |
||
54 |
/** |
|
55 |
* If the client name is not found on server's user database. |
|
56 |
*/ |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
57 |
public static final int USER_UNKNOWN = 3; |
6517 | 58 |
|
59 |
/** |
|
60 |
* If authentication fails. |
|
61 |
*/ |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
62 |
public static final int AUTH_FAILED = 4; |
6517 | 63 |
|
64 |
/** |
|
65 |
* If an illegal version string is provided. |
|
66 |
*/ |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
67 |
public static final int BAD_VERSION = 5; |
6517 | 68 |
|
10348
7d1a82029332
7043847: NTML impl of SaslServer throws UnsupportedOperationException from (un)wrap method
weijun
parents:
10336
diff
changeset
|
69 |
/** |
7d1a82029332
7043847: NTML impl of SaslServer throws UnsupportedOperationException from (un)wrap method
weijun
parents:
10336
diff
changeset
|
70 |
* Protocol errors. |
7d1a82029332
7043847: NTML impl of SaslServer throws UnsupportedOperationException from (un)wrap method
weijun
parents:
10336
diff
changeset
|
71 |
*/ |
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
25859
diff
changeset
|
72 |
public static final int PROTOCOL = 6; |
10348
7d1a82029332
7043847: NTML impl of SaslServer throws UnsupportedOperationException from (un)wrap method
weijun
parents:
10336
diff
changeset
|
73 |
|
6517 | 74 |
private int errorCode; |
75 |
||
76 |
/** |
|
77 |
* Constructs an NTLMException object. |
|
78 |
* @param errorCode the error code, which can be retrieved by |
|
79 |
* the {@link #errorCode() } method. |
|
80 |
* @param msg the string message, which can be retrived by |
|
81 |
* the {@link Exception#getMessage() } method. |
|
82 |
*/ |
|
83 |
public NTLMException(int errorCode, String msg) { |
|
84 |
super(msg); |
|
85 |
this.errorCode = errorCode; |
|
86 |
} |
|
87 |
||
88 |
/** |
|
89 |
* Returns the error code associated with this NTLMException. |
|
90 |
* @return the error code |
|
91 |
*/ |
|
92 |
public int errorCode() { |
|
93 |
return errorCode; |
|
94 |
} |
|
95 |
} |