Package org.ietf.jgss

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:
Serialized Form
  • Field Details

  • Constructor Details

    • GSSException

      public GSSException​(int majorCode)
      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

      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:
      getMajorString(), getMinor(), getMinorString()
    • 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:
      getMinorString(), setMinor(int, java.lang.String)
    • 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:
      getMajor(), toString()
    • 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:
      getMinor(), getMajorString(), toString()
    • 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:
      getMinor()
    • 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