org.ietf.jgss
public class: GSSException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.ietf.jgss.GSSException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GSSExceptionImpl
This exception is thrown whenever a GSS-API error occurs, including
any mechanism specific error. It may contain both the major and the
minor GSS-API status codes. Major error codes are those defined at the
GSS-API level in this class. Minor error codes are mechanism specific
error codes that can provide additional information. The underlying
mechanism implementation is responsible for setting appropriate minor
status codes when throwing this exception. Aside from delivering the
numeric error codes to the caller, this class performs the mapping from
their numeric values to textual representations.
- author:
Mayank - Upadhyay
- since:
1.4 -
| Field Summary |
|---|
| public static final int | BAD_BINDINGS | Channel bindings mismatch. |
| public static final int | BAD_MECH | Unsupported mechanism requested. |
| public static final int | BAD_NAME | Invalid name provided. |
| public static final int | BAD_NAMETYPE | Name of unsupported type provided. |
| public static final int | BAD_STATUS | Invalid status code. |
| public static final int | BAD_MIC | Token had invalid integrity check. |
| public static final int | CONTEXT_EXPIRED | Security context expired. |
| public static final int | CREDENTIALS_EXPIRED | Expired credentials. |
| public static final int | DEFECTIVE_CREDENTIAL | Defective credentials. |
| public static final int | DEFECTIVE_TOKEN | Defective token. |
| public static final int | FAILURE | General failure, unspecified at GSS-API level. |
| public static final int | NO_CONTEXT | Invalid security context. |
| public static final int | NO_CRED | Invalid credentials. |
| public static final int | BAD_QOP | Unsupported QOP value. |
| public static final int | UNAUTHORIZED | Operation unauthorized. |
| public static final int | UNAVAILABLE | Operation unavailable. |
| public static final int | DUPLICATE_ELEMENT | Duplicate credential element requested. |
| public static final int | NAME_NOT_MN | Name contains multi-mechanism elements. |
| public static final int | DUPLICATE_TOKEN | The token was a duplicate of an earlier token.
This is a fatal error code that may occur during
context establishment. It is not used to indicate
supplementary status values. The MessageProp object is
used for that purpose. |
| public static final int | OLD_TOKEN | The token's validity period has expired. This is a
fatal error code that may occur during context establishment.
It is not used to indicate supplementary status values.
The MessageProp object is used for that purpose. |
| public static final int | UNSEQ_TOKEN | A later token has already been processed. This is a
fatal error code that may occur during context establishment.
It is not used to indicate supplementary status values.
The MessageProp object is used for that purpose. |
| public static final int | GAP_TOKEN | An expected per-message token was not received. This is a
fatal error code that may occur during context establishment.
It is not used to indicate supplementary status values.
The MessageProp object is used for that purpose. |
| Constructor: |
public GSSException(int majorCode) {
if (validateMajor(majorCode))
major = majorCode;
else
major = FAILURE;
}
Creates a GSSException object with a specified major code. Parameters:
majorCode - the The GSS error code for the problem causing this
exception to be thrown.
|
GSSException(int majorCode,
String majorString) {
if (validateMajor(majorCode))
major = majorCode;
else
major = FAILURE;
this.majorString = majorString;
}
Construct a GSSException object with a specified major code and a
specific major string for it. Parameters:
majorCode - the fatal error code causing this exception.
majorString - an expicit message to be included in this exception
|
public GSSException(int majorCode,
int minorCode,
String minorString) {
if (validateMajor(majorCode))
major = majorCode;
else
major = FAILURE;
minor = minorCode;
minorMessage = minorString;
}
Creates a GSSException object with the specified major code, minor
code, and minor code textual explanation. This constructor is to be
used when the exception is originating from the underlying mechanism
level. It allows the setting of both the GSS code and the mechanism
code. Parameters:
majorCode - the GSS error code for the problem causing this
exception to be thrown.
minorCode - the mechanism level error code for the problem
causing this exception to be thrown.
minorString - the textual explanation of the mechanism error
code.
|
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Method from org.ietf.jgss.GSSException Detail: |
public int getMajor() {
return major;
}
Returns the GSS-API level major error code for the problem causing
this exception to be thrown. Major error codes are
defined at the mechanism independent GSS-API level in this
class. Mechanism specific error codes that might provide more
information aer set as the minor error code. |
public String getMajorString() {
if (majorString != null)
return majorString;
else
return messages[major - 1];
}
Returns a string explaining the GSS-API level major error code in
this exception. |
public String getMessage() {
if (minor == 0)
return (getMajorString());
return (getMajorString()
+ " (Mechanism level: " + getMinorString() + ")");
}
Returns a textual representation of both the major and the minor
status codes. |
public int getMinor() {
return minor;
}
Returns the mechanism level error code for the problem causing this
exception to be thrown. The minor code is set by the underlying
mechanism. |
public String getMinorString() {
return minorMessage;
}
Returns a string explaining the mechanism specific error code.
If the minor status code is 0, then no mechanism level error details
will be available. |
public void setMinor(int minorCode,
String message) {
minor = minorCode;
minorMessage = message;
}
Used by the exception thrower to set the mechanism
level minor error code and its string explanation. This is used by
mechanism providers to indicate error details. |
public String toString() {
return ("GSSException: " + getMessage());
}
Returns a textual representation of both the major and the minor
status codes. |