org.keycloak.events.admin

## Class AdminEvent

- java.lang.Object
- - org.keycloak.events.admin.AdminEvent

-     public class AdminEvent
      extends Object

  Author:
    Stian Thorgersen

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdminEvent()`
    `AdminEvent(AdminEvent toCopy)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AuthDetails` | `getAuthDetails()` Returns authentication details
    `String` | `getError()` If the event was unsuccessful returns the error message.
    `OperationType` | `getOperationType()` Returns the type of the operation
    `String` | `getRealmId()` Returns the id of the realm
    `String` | `getRepresentation()` Returns the updated JSON representation if `operationType` is `CREATE` or `UPDATE`.
    `String` | `getResourcePath()` Returns the path of the resource.
    `ResourceType` | `getResourceType()` Returns the type of the affected `ResourceType` for this `AdminEvent`, e.g.
    `String` | `getResourceTypeAsString()` Returns the type as string.
    `long` | `getTime()` Returns the time of the event
    `void` | `setAuthDetails(AuthDetails authDetails)`
    `void` | `setError(String error)`
    `void` | `setOperationType(OperationType operationType)`
    `void` | `setRealmId(String realmId)`
    `void` | `setRepresentation(String representation)`
    `void` | `setResourcePath(String resourcePath)`
    `void` | `setResourceType(ResourceType resourceType)`
    `void` | `setResourceTypeAsString(String resourceType)` Setter for custom resource types with values different from `ResourceType`.
    `void` | `setTime(long time)`

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

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

- - ### Constructor Detail

    - #### AdminEvent

          public AdminEvent()

    - #### AdminEvent

          public AdminEvent(AdminEvent toCopy)

  - ### Method Detail

    - #### getTime

          public long getTime()

      Returns the time of the event
      Returns:
        time in millis

    - #### setTime

          public void setTime(long time)

    - #### getRealmId

          public String getRealmId()

      Returns the id of the realm
      Returns:

    - #### setRealmId

          public void setRealmId(String realmId)

    - #### getAuthDetails

          public AuthDetails getAuthDetails()

      Returns authentication details
      Returns:

    - #### setAuthDetails

          public void setAuthDetails(AuthDetails authDetails)

    - #### getOperationType

          public OperationType getOperationType()

      Returns the type of the operation
      Returns:

    - #### setOperationType

          public void setOperationType(OperationType operationType)

    - #### getResourcePath

          public String getResourcePath()

      Returns the path of the resource. For example:
      - realms - realm list
      - realms/master - master realm
      - realms/clients/00d4b16f-f1f9-4e73-8366-d76b18f3e0e1 - client within the master realm
      Returns:

    - #### setResourcePath

          public void setResourcePath(String resourcePath)

    - #### getRepresentation

          public String getRepresentation()

      Returns the updated JSON representation if `operationType` is `CREATE` or `UPDATE`. Otherwise returns `null`.
      Returns:

    - #### setRepresentation

          public void setRepresentation(String representation)

    - #### getError

          public String getError()

      If the event was unsuccessful returns the error message. Otherwise returns `null`.
      Returns:

    - #### setError

          public void setError(String error)

    - #### getResourceType

          public ResourceType getResourceType()

      Returns the type of the affected `ResourceType` for this `AdminEvent`, e.g. `USER`, `GROUP` etc.
      Returns:

    - #### setResourceType

          public void setResourceType(ResourceType resourceType)

    - #### getResourceTypeAsString

          public String getResourceTypeAsString()

      Returns the type as string. Custom resource types with values different from `ResourceType` are possible. In this case `getResourceType()` returns `CUSTOM`.
      Returns:

    - #### setResourceTypeAsString

          public void setResourceTypeAsString(String resourceType)

      Setter for custom resource types with values different from `ResourceType`.

Copyright © 2021 JBoss by Red Hat. All rights reserved.