Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/security/ntlm/NTLMException.java
38924 views
/*1* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.security.ntlm;2627import java.security.GeneralSecurityException;2829/**30* An NTLM-related Exception31*/32public final class NTLMException extends GeneralSecurityException {33private static final long serialVersionUID = -3298539507906689430L;3435/**36* If the incoming packet is invalid.37*/38public final static int PACKET_READ_ERROR = 1;3940/**41* If the client cannot get a domain value from the server and the42* caller has not provided one.43*/44public final static int NO_DOMAIN_INFO = 2;4546/**47* If the domain provided by the client does not match the one received48* from server.49*/50//public final static int DOMAIN_UNMATCH = 3;5152/**53* If the client name is not found on server's user database.54*/55public final static int USER_UNKNOWN = 3;5657/**58* If authentication fails.59*/60public final static int AUTH_FAILED = 4;6162/**63* If an illegal version string is provided.64*/65public final static int BAD_VERSION = 5;6667/**68* Protocol errors.69*/70public final static int PROTOCOL = 6;7172private int errorCode;7374/**75* Constructs an NTLMException object.76* @param errorCode the error code, which can be retrieved by77* the {@link #errorCode() } method.78* @param msg the string message, which can be retrived by79* the {@link Exception#getMessage() } method.80*/81public NTLMException(int errorCode, String msg) {82super(msg);83this.errorCode = errorCode;84}8586/**87* Returns the error code associated with this NTLMException.88* @return the error code89*/90public int errorCode() {91return errorCode;92}93}949596