Class LdapConfigurationResource


  • @Path("/config/database/ldap")
    @Produces("application/json")
    @Consumes("application/json")
    public class LdapConfigurationResource
    extends ConfigBaseResource
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      jakarta.ws.rs.core.Response addLdapConfiguration​(@Valid @NotNull io.jans.model.ldap.GluuLdapConfiguration ldapConfiguration)
      Create a new LDAP configuration.
      jakarta.ws.rs.core.Response deleteLdapConfigurationByName​(String name)
      Deletes the LDAP configuration with the given name.
      jakarta.ws.rs.core.Response getLdapConfiguration()
      Retrieves all LDAP configurations.
      jakarta.ws.rs.core.Response getLdapConfigurationByName​(String name)
      Retrieves the LDAP configuration identified by the given name.
      jakarta.ws.rs.core.Response patchLdapConfigurationByName​(String name, @NotNull String requestString)
      Applies a JSON Patch to the LDAP configuration identified by the given name and persists the updated configuration.
      jakarta.ws.rs.core.Response testLdapConfigurationByName​(@Valid @NotNull io.jans.model.ldap.GluuLdapConfiguration ldapConfiguration)
      Check whether the provided LDAP configuration can establish a connection to its LDAP server.
      jakarta.ws.rs.core.Response updateLdapConfiguration​(@Valid @NotNull io.jans.model.ldap.GluuLdapConfiguration ldapConfiguration)
      Update an existing LDAP configuration.
      • Methods inherited from class io.jans.configapi.core.rest.BaseResource

        checkNotEmpty, checkNotEmpty, checkNotNull, checkNotNull, checkNotNull, checkResourceNotNull, createSearchRequest, findRootError, getBadRequestException, getBadRequestException, getBadRequestException, getHttpHeaders, getHttpRequest, getInternalServerException, getInternalServerException, getMissingAttributeError, getNotAcceptableException, getNotFoundError, getNotFoundError, getUriInfo, throwBadRequestException, throwBadRequestException, throwBadRequestException, throwInternalServerException, throwInternalServerException, throwInternalServerException, throwInternalServerException, throwMissingAttributeError, throwNotFoundException, throwNotFoundException
    • Constructor Detail

      • LdapConfigurationResource

        public LdapConfigurationResource()
    • Method Detail

      • getLdapConfiguration

        @GET
        public jakarta.ws.rs.core.Response getLdapConfiguration()
        Retrieves all LDAP configurations.
        Returns:
        a list of GluuLdapConfiguration objects; empty list if none exist.
      • getLdapConfigurationByName

        @GET
        @Path("/{name}")
        public jakarta.ws.rs.core.Response getLdapConfigurationByName​(@PathParam("name")
                                                                      String name)
        Retrieves the LDAP configuration identified by the given name.
        Parameters:
        name - the LDAP configuration name to retrieve
        Returns:
        the matching GluuLdapConfiguration
        Throws:
        javax.ws.rs.NotFoundException - if no configuration with the given name exists
      • addLdapConfiguration

        @POST
        public jakarta.ws.rs.core.Response addLdapConfiguration​(@Valid @NotNull
                                                                @Valid @NotNull io.jans.model.ldap.GluuLdapConfiguration ldapConfiguration)
        Create a new LDAP configuration. Attempts to persist the provided GluuLdapConfiguration and returns the created resource.
        Parameters:
        ldapConfiguration - the LDAP configuration to create
        Returns:
        a Response containing the created GluuLdapConfiguration with HTTP status 201 (Created)
        Throws:
        jakarta.ws.rs.NotAcceptableException - if a configuration with the same configId already exists
      • updateLdapConfiguration

        @PUT
        public jakarta.ws.rs.core.Response updateLdapConfiguration​(@Valid @NotNull
                                                                   @Valid @NotNull io.jans.model.ldap.GluuLdapConfiguration ldapConfiguration)
        Update an existing LDAP configuration.
        Parameters:
        ldapConfiguration - the LDAP configuration to persist; its `configId` must match an existing configuration
        Returns:
        the updated GluuLdapConfiguration
      • deleteLdapConfigurationByName

        @DELETE
        @Path("/{name}")
        public jakarta.ws.rs.core.Response deleteLdapConfigurationByName​(@PathParam("name")
                                                                         String name)
        Deletes the LDAP configuration with the given name.
        Parameters:
        name - the name of the LDAP configuration to delete
        Returns:
        a Response with HTTP 204 No Content on success
        Throws:
        jakarta.ws.rs.NotFoundException - if no configuration with the given name exists
      • patchLdapConfigurationByName

        @PATCH
        @Path("/{name}")
        @Consumes("application/json-patch+json")
        public jakarta.ws.rs.core.Response patchLdapConfigurationByName​(@PathParam("name")
                                                                        String name,
                                                                        @NotNull
                                                                        @NotNull String requestString)
                                                                 throws com.github.fge.jsonpatch.JsonPatchException,
                                                                        IOException
        Applies a JSON Patch to the LDAP configuration identified by the given name and persists the updated configuration.
        Parameters:
        name - the identifier of the LDAP configuration to patch
        requestString - the JSON Patch payload as a string
        Returns:
        the updated GluuLdapConfiguration
        Throws:
        com.github.fge.jsonpatch.JsonPatchException - if the patch cannot be applied to the configuration
        IOException - if an I/O error occurs while processing the patch
      • testLdapConfigurationByName

        @POST
        @Path("/test")
        public jakarta.ws.rs.core.Response testLdapConfigurationByName​(@Valid @NotNull
                                                                       @Valid @NotNull io.jans.model.ldap.GluuLdapConfiguration ldapConfiguration)
        Check whether the provided LDAP configuration can establish a connection to its LDAP server.
        Parameters:
        ldapConfiguration - the LDAP configuration to test connectivity for
        Returns:
        HTTP 200 response containing `true` if a connection to the LDAP server can be established using the provided configuration, `false` otherwise