Class GSSException

All Implemented Interfaces:
Serializable

public class GSSException extends Exception
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.
Since:
1.4
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Channel bindings mismatch.
    static final int
    Unsupported mechanism requested.
    static final int
    Token had invalid integrity check.
    static final int
    Invalid name provided.
    static final int
    Name of unsupported type provided.
    static final int
    Unsupported QOP value.
    static final int
    Invalid status code.
    static final int
    Security context expired.
    static final int
    Expired credentials.
    static final int
    Defective credentials.
    static final int
    Defective token.
    static final int
    Duplicate credential element requested.
    static final int
    The token was a duplicate of an earlier token.
    static final int
    General failure, unspecified at GSS-API level.
    static final int
    An expected per-message token was not received.
    static final int
    Name contains multi-mechanism elements.
    static final int
    Invalid security context.
    static final int
    Invalid credentials.
    static final int
    The token's validity period has expired.
    static final int
    Operation unauthorized.
    static final int
    Operation unavailable.
    static final int
    A later token has already been processed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GSSException(int majorCode)
    Creates a GSSException object with a specified major code.
    GSSException(int majorCode, int minorCode, String minorString)
    Creates a GSSException object with the specified major code, minor code, and minor code textual explanation.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the GSS-API level major error code for the problem causing this exception to be thrown.
    Returns a string explaining the GSS-API level major error code in this exception.
    Returns a textual representation of both the major and the minor status codes.
    int
    Returns the mechanism level error code for the problem causing this exception to be thrown.
    Returns a string explaining the mechanism specific error code.
    void
    setMinor(int minorCode, String message)
    Used by the exception thrower to set the mechanism level minor error code and its string explanation.
    Returns a textual representation of both the major and the minor status codes.

    Methods declared in class Throwable

    addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
    Modifier and Type
    Method
    Description
    final void
    The specified exception is going to be suppressed in order to give priority to this exception (primary exception) and to be appended to the list of suppressed exceptions.
    Record in the receiver a walkback from the point where this message was sent.
    Answers the cause of this Throwable, or null if there is no cause.
    Answers the extra information message which was provided when the throwable was created.
    Answers an array of StackTraceElement.
    final Throwable[]
    Returns an array of exceptions suppressed, typically by the automatically generated code from the try-with-resources statement, in order to give priority to this exception (primary exception).
    initCause(Throwable throwable)
    Initialize the cause of the receiver.
    void
    Outputs a printable representation of the receiver's walkback on the System.err stream.
    void
    Outputs a printable representation of the receiver's walkback on the stream specified by the argument.
    void
    Outputs a printable representation of the receiver's walkback on the writer specified by the argument.
    void
    Sets the array of StackTraceElements.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Field Details

    • BAD_BINDINGS

      public static final int BAD_BINDINGS
      Channel bindings mismatch.
      See Also:
    • BAD_MECH

      public static final int BAD_MECH
      Unsupported mechanism requested.
      See Also:
    • BAD_NAME

      public static final int BAD_NAME
      Invalid name provided.
      See Also:
    • BAD_NAMETYPE

      public static final int BAD_NAMETYPE
      Name of unsupported type provided.
      See Also:
    • BAD_STATUS

      public static final int BAD_STATUS
      Invalid status code.
      See Also:
    • BAD_MIC

      public static final int BAD_MIC
      Token had invalid integrity check.
      See Also:
    • CONTEXT_EXPIRED

      public static final int CONTEXT_EXPIRED
      Security context expired.
      See Also:
    • CREDENTIALS_EXPIRED

      public static final int CREDENTIALS_EXPIRED
      Expired credentials.
      See Also:
    • DEFECTIVE_CREDENTIAL

      public static final int DEFECTIVE_CREDENTIAL
      Defective credentials.
      See Also:
    • DEFECTIVE_TOKEN

      public static final int DEFECTIVE_TOKEN
      Defective token.
      See Also:
    • FAILURE

      public static final int FAILURE
      General failure, unspecified at GSS-API level.
      See Also:
    • NO_CONTEXT

      public static final int NO_CONTEXT
      Invalid security context.
      See Also:
    • NO_CRED

      public static final int NO_CRED
      Invalid credentials.
      See Also:
    • BAD_QOP

      public static final int BAD_QOP
      Unsupported QOP value.
      See Also:
    • UNAUTHORIZED

      public static final int UNAUTHORIZED
      Operation unauthorized.
      See Also:
    • UNAVAILABLE

      public static final int UNAVAILABLE
      Operation unavailable.
      See Also:
    • DUPLICATE_ELEMENT

      public static final int DUPLICATE_ELEMENT
      Duplicate credential element requested.
      See Also:
    • NAME_NOT_MN

      public static final int NAME_NOT_MN
      Name contains multi-mechanism elements.
      See Also:
    • DUPLICATE_TOKEN

      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.
      See Also:
    • OLD_TOKEN

      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.
      See Also:
    • UNSEQ_TOKEN

      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.
      See Also:
    • GAP_TOKEN

      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.
      See Also:
  • Constructor Details

    • GSSException

      public GSSException(int majorCode)
      Creates a GSSException object with a specified major code.
      Parameters:
      majorCode - the GSS error code for the problem causing this exception to be thrown.
    • GSSException

      public GSSException(int majorCode, int minorCode, String 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.
  • Method Details

    • getMajor

      public int getMajor()
      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 are set as the minor error code.
      Returns:
      int the GSS-API level major error code causing this exception
      See Also:
    • getMinor

      public int getMinor()
      Returns the mechanism level error code for the problem causing this exception to be thrown. The minor code is set by the underlying mechanism.
      Returns:
      int the mechanism error code; 0 indicates that it has not been set.
      See Also:
    • getMajorString

      public String getMajorString()
      Returns a string explaining the GSS-API level major error code in this exception.
      Returns:
      String explanation string for the major error code
      See Also:
    • getMinorString

      public String getMinorString()
      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.
      Returns:
      String a textual explanation of mechanism error code
      See Also:
    • setMinor

      public void setMinor(int minorCode, String 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.
      Parameters:
      minorCode - the mechanism specific error code
      message - textual explanation of the mechanism error code
      See Also:
    • toString

      public String toString()
      Returns a textual representation of both the major and the minor status codes.
      Overrides:
      toString in class Throwable
      Returns:
      a String with the error descriptions
    • getMessage

      public String getMessage()
      Returns a textual representation of both the major and the minor status codes.
      Overrides:
      getMessage in class Throwable
      Returns:
      a String with the error descriptions