이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 301. Spring LDAP Component


Available as of Camel version 2.11

The spring-ldap: component provides a Camel wrapper for Spring LDAP.

Maven users will need to add the following dependency to their pom.xml for this component:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-spring-ldap</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

301.1. URI format

spring-ldap:springLdapTemplate[?options]

Where springLdapTemplate is the name of the Spring LDAP Template bean. In this bean, you configure the URL and the credentials for your LDAP access.

301.2. Options

The Spring LDAP component has no options.

The Spring LDAP endpoint is configured using URI syntax:

spring-ldap:templateName

with the following path and query parameters:

301.2.1. Path Parameters (1 parameters):

NameDescriptionDefaultType

templateName

Required Name of the Spring LDAP Template bean

 

String

301.2.2. Query Parameters (3 parameters):

NameDescriptionDefaultType

operation (producer)

Required The LDAP operation to be performed.

 

LdapOperation

scope (producer)

The scope of the search operation.

subtree

String

synchronous (advanced)

Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

false

boolean

301.3. Usage

The component supports producer endpoint only. An attempt to create a consumer endpoint will result in an UnsupportedOperationException.
The body of the message must be a map (an instance of java.util.Map). Unless a base DN is specified by in the configuration of your ContextSource, this map must contain at least an entry with the key dn (not needed for function_driven operation) that specifies the root node for the LDAP operation to be performed. Other entries of the map are operation-specific (see below).

The body of the message remains unchanged for the bind and unbind operations. For the search and function_driven operations, the body is set to the result of the search, see http://static.springsource.org/spring-ldap/site/apidocs/org/springframework/ldap/core/LdapTemplate.html#search%28java.lang.String,%20java.lang.String,%20int,%20org.springframework.ldap.core.AttributesMapper%29.

301.3.2. Bind

The message body must have an entry with the key attributes. The value must be an instance of javax.naming.directory.Attributes This entry specifies the LDAP node to be created.

301.3.3. Unbind

No further entries necessary, the node with the specified dn is deleted.

301.3.4. Authenticate

The message body must have entries with the keys filter and password. The values must be an instance of String representing a valid LDAP filter and a user password, respectively.

301.3.5. Modify Attributes

The message body must have an entry with the key modificationItems. The value must be an instance of any array of type javax.naming.directory.ModificationItem

301.3.6. Function-Driven

The message body must have entries with the keys function and request. The function value must be of type java.util.function.BiFunction<L, Q, S>. The L type parameter must be of type org.springframework.ldap.core.LdapOperations. The request value must be the same type as the Q type parameter in the function and it must encapsulate the parameters expected by the LdapTemplate method being invoked within the function. The S type parameter represents the response type as returned by the LdapTemplate method being invoked. This operation allows dynamic invocation of LdapTemplate methods that are not covered by the operations mentioned above.

Key definitions

In order to avoid spelling errors, the following constants are defined in org.apache.camel.springldap.SpringLdapProducer:

  • public static final String DN = "dn"
  • public static final String FILTER = "filter"
  • public static final String ATTRIBUTES = "attributes"
  • public static final String PASSWORD = "password";
  • public static final String MODIFICATION_ITEMS = "modificationItems";
  • public static final String FUNCTION = "function";
  • public static final String REQUEST = "request";
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.