NotAuthorizedException (Apache Geode 1.3.0)
Date: 2017-10-26

org.apache.geode.security

## Class NotAuthorizedException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.apache.geode.GemFireException
        - - org.apache.geode.security.GemFireSecurityException
          - - org.apache.geode.security.NotAuthorizedException

- All Implemented Interfaces:
    java.io.Serializable

      public class NotAuthorizedException
      extends GemFireSecurityException

  Thrown when a client/peer is unauthorized to perform a requested operation.
  Since:
    GemFire 5.5
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NotAuthorizedException(java.lang.String message)` Constructs a new exception with the specified detail message and principal.
    `NotAuthorizedException(java.lang.String message, java.security.Principal principal)` Constructs a new exception with the specified detail message and principal.
    `NotAuthorizedException(java.lang.String message, java.lang.Throwable cause)` Constructs a new exception with the specified detail message and cause.
    `NotAuthorizedException(java.lang.String message, java.lang.Throwable cause, java.security.Principal principal)` Constructs a new exception with the specified detail message, cause and principal.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.security.Principal` | `getPrincipal()` Returns the `principal` for which authorization failed.

    - ### Methods inherited from class org.apache.geode.security.GemFireSecurityException

      `getCause, getResolvedObj, isSerializable`

    - ### Methods inherited from class org.apache.geode.GemFireException

      `getRootCause`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NotAuthorizedException

          public NotAuthorizedException(java.lang.String message)

      Constructs a new exception with the specified detail message and principal.
      Parameters:
        `message` - the detail message (which is saved for later retrieval by the `Throwable.getMessage()` method). (A `null` value is permitted.)

    - #### NotAuthorizedException

          public NotAuthorizedException(java.lang.String message,
                                        java.lang.Throwable cause)

      Constructs a new exception with the specified detail message and cause.

      If `message` is null, then the detail message associated with `cause` is automatically used as this exception's detail message.

      Parameters:
        `message` - the detail message (which is saved for later retrieval by the `Throwable.getMessage()` method). (A `null` value is permitted.)
        `cause` - the cause (which is saved for later retrieval by the `GemFireSecurityException.getCause()` method). (A `null` value is permitted, and indicates that the cause is nonexistent or unknown.)

    - #### NotAuthorizedException

          public NotAuthorizedException(java.lang.String message,
                                        java.security.Principal principal)

      Constructs a new exception with the specified detail message and principal.
      Parameters:
        `message` - the detail message (which is saved for later retrieval by the `Throwable.getMessage()` method). (A `null` value is permitted.)
        `principal` - the principal for which authorization failed. (A `null` value is permitted.)

    - #### NotAuthorizedException

          public NotAuthorizedException(java.lang.String message,
                                        java.lang.Throwable cause,
                                        java.security.Principal principal)

      Constructs a new exception with the specified detail message, cause and principal.

      If `message` is null, then the detail message associated with `cause` is automatically used as this exception's detail message.

      Parameters:
        `message` - the detail message (which is saved for later retrieval by the `Throwable.getMessage()` method). (A `null` value is permitted.)
        `cause` - the cause (which is saved for later retrieval by the `GemFireSecurityException.getCause()` method). (A `null` value is permitted, and indicates that the cause is nonexistent or unknown.)
        `principal` - the principal for which authorization failed. (A `null` value is permitted.)

  - ### Method Detail

    - #### getPrincipal

          public java.security.Principal getPrincipal()

      Returns the `principal` for which authorization failed.
      Returns:
        the `principal` for which authorization failed.