org.keycloak.services.resources.admin

## Class ProtocolMappersResource

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

-     public class ProtocolMappersResource
      extends Object

  Base resource for managing users
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AdminEventBuilder` | `adminEvent`
    `protected AdminPermissionEvaluator` | `auth`
    `protected ProtocolMapperContainerModel` | `client`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected AdminPermissionEvaluator.RequirePermissionCheck` | `managePermission`
    `protected RealmModel` | `realm`
    `protected KeycloakSession` | `session`
    `protected AdminPermissionEvaluator.RequirePermissionCheck` | `viewPermission`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProtocolMappersResource(RealmModel realm, ProtocolMapperContainerModel client, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent, AdminPermissionEvaluator.RequirePermissionCheck managePermission, AdminPermissionEvaluator.RequirePermissionCheck viewPermission)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `createMapper(List<ProtocolMapperRepresentation> reps)` Create multiple mappers
    `javax.ws.rs.core.Response` | `createMapper(ProtocolMapperRepresentation rep)` Create a mapper
    `void` | `delete(String id)` Delete the mapper
    `ProtocolMapperRepresentation` | `getMapperById(String id)` Get mapper by id
    `Stream<ProtocolMapperRepresentation>` | `getMappers()` Get mappers
    `Stream<ProtocolMapperRepresentation>` | `getMappersPerProtocol(String protocol)` Get mappers by name for a specific protocol
    `void` | `update(String id, ProtocolMapperRepresentation rep)` Update the mapper

    - ### 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

    - #### realm

          protected RealmModel realm

    - #### client

          protected ProtocolMapperContainerModel client

    - #### auth

          protected AdminPermissionEvaluator auth

    - #### managePermission

          protected AdminPermissionEvaluator.RequirePermissionCheck managePermission

    - #### viewPermission

          protected AdminPermissionEvaluator.RequirePermissionCheck viewPermission

    - #### adminEvent

          protected AdminEventBuilder adminEvent

    - #### session

          @Context
          protected KeycloakSession session

  - ### Constructor Detail

    - #### ProtocolMappersResource

          public ProtocolMappersResource(RealmModel realm,
                                         ProtocolMapperContainerModel client,
                                         AdminPermissionEvaluator auth,
                                         AdminEventBuilder adminEvent,
                                         AdminPermissionEvaluator.RequirePermissionCheck managePermission,
                                         AdminPermissionEvaluator.RequirePermissionCheck viewPermission)

  - ### Method Detail

    - #### getMappersPerProtocol

          @GET
           @Path(value="protocol/{protocol}")
           @Produces(value="application/json")
          public Stream<ProtocolMapperRepresentation> getMappersPerProtocol(@PathParam(value="protocol")
                                                                                                                                                          String protocol)

      Get mappers by name for a specific protocol
      Parameters:
        `protocol` -
      Returns:

    - #### createMapper

          @Path(value="models")
           @POST
           @Consumes(value="application/json")
          public javax.ws.rs.core.Response createMapper(ProtocolMapperRepresentation rep)

      Create a mapper
      Parameters:
        `rep` -

    - #### createMapper

          @Path(value="add-models")
           @POST
           @Consumes(value="application/json")
          public void createMapper(List<ProtocolMapperRepresentation> reps)

      Create multiple mappers

    - #### getMappers

          @GET
           @Path(value="models")
           @Produces(value="application/json")
          public Stream<ProtocolMapperRepresentation> getMappers()

      Get mappers
      Returns:

    - #### getMapperById

          @GET
           @Path(value="models/{id}")
           @Produces(value="application/json")
          public ProtocolMapperRepresentation getMapperById(@PathParam(value="id")
                                                                                                                                  String id)

      Get mapper by id
      Parameters:
        `id` - Mapper id
      Returns:

    - #### update

          @PUT
           @Path(value="models/{id}")
           @Consumes(value="application/json")
          public void update(@PathParam(value="id")
                                                                                                   String id,
                                                                                                   ProtocolMapperRepresentation rep)

      Update the mapper
      Parameters:
        `id` - Mapper id
        `rep` -

    - #### delete

          @DELETE
           @Path(value="models/{id}")
          public void delete(@PathParam(value="id")
                                                                 String id)

      Delete the mapper
      Parameters:
        `id` - Mapper id

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