org.keycloak.services.resources.admin

## Class RealmsAdminResource

- java.lang.Object
- - org.keycloak.services.resources.admin.RealmsAdminResource

-     public class RealmsAdminResource
      extends Object

  Top level resource for Admin REST API
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AdminAuth` | `auth`
    `protected KeycloakApplication` | `keycloak`
    `protected static org.jboss.logging.Logger` | `logger`
    `static javax.ws.rs.core.CacheControl` | `noCache`
    `protected KeycloakSession` | `session`
    `protected TokenManager` | `tokenManager`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RealmsAdminResource(AdminAuth auth, TokenManager tokenManager)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addRealmRep(List<RealmRepresentation> reps, RealmModel realm, ApplicationModel realmManagementApplication)`
    `RealmAdminResource` | `getRealmAdmin(javax.ws.rs.core.HttpHeaders headers, String name)` Base path for the admin REST API for one particular realm.
    `List<RealmRepresentation>` | `getRealms()` Returns a list of realms.
    `javax.ws.rs.core.Response` | `importRealm(javax.ws.rs.core.UriInfo uriInfo, RealmRepresentation rep)` Import a realm from a full representation of that realm.
    `javax.ws.rs.core.Response` | `uploadRealm(javax.ws.rs.core.UriInfo uriInfo, org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input)` Upload a realm from a uploaded JSON file.

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

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

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### auth

          protected AdminAuth auth

    - #### tokenManager

          protected TokenManager tokenManager

    - #### noCache

          public static final javax.ws.rs.core.CacheControl noCache

    - #### session

          @Context
          protected KeycloakSession session

    - #### keycloak

          @Context
          protected KeycloakApplication keycloak

  - ### Constructor Detail

    - #### RealmsAdminResource

          public RealmsAdminResource(AdminAuth auth,
                             TokenManager tokenManager)

  - ### Method Detail

    - #### getRealms

          @GET
          @Produces(value="application/json")
          public List<RealmRepresentation> getRealms()

      Returns a list of realms. This list is filtered based on what realms the caller is allowed to view.
      Returns:

    - #### addRealmRep

          protected void addRealmRep(List<RealmRepresentation> reps,
                         RealmModel realm,
                         ApplicationModel realmManagementApplication)

    - #### importRealm

          @POST
          @Consumes(value="application/json")
          public javax.ws.rs.core.Response importRealm(@Context
                                                            javax.ws.rs.core.UriInfo uriInfo,
                                                            RealmRepresentation rep)

      Import a realm from a full representation of that realm. Realm name must be unique.
      Parameters:
        `uriInfo` -
        `rep` - JSON representation
      Returns:

    - #### uploadRealm

          @POST
          @Consumes(value="multipart/form-data")
          public javax.ws.rs.core.Response uploadRealm(@Context
                                                            javax.ws.rs.core.UriInfo uriInfo,
                                                            org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input)
                                                throws IOException

      Upload a realm from a uploaded JSON file. The posted represenation is expected to be a multipart/form-data encapsulation of a JSON file. The same format a browser would use when uploading a file.
      Parameters:
        `uriInfo` -
        `input` - multipart/form data
      Returns:
      Throws:
        `IOException`

    - #### getRealmAdmin

          @Path(value="{realm}")
          public RealmAdminResource getRealmAdmin(@Context
                                              javax.ws.rs.core.HttpHeaders headers,
                                              @PathParam(value="realm")
                                              String name)

      Base path for the admin REST API for one particular realm.
      Parameters:
        `headers` -
        `name` - realm name (not id!)
      Returns:

Copyright © 2015. All Rights Reserved.