camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Spring LDAP
Date Thu, 28 Feb 2013 05:43:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Spring+LDAP">Spring
LDAP</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >h2. Spring LDAP Component <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*Available
since Camel 2.11* <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">_available
since: 2.11_ <br> <br></td></tr>
            <tr><td class="diff-unchanged" >The *spring-ldap:* component provides
a Camel wrapper for [Spring LDAP|http://www.springsource.org/ldap]. <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="SpringLDAP-SpringLDAPComponent"></a>Spring LDAP Component</h2>
<p><b>Available since Camel 2.11</b></p>

<p>The <b>spring-ldap:</b> component provides a Camel wrapper for <a
href="http://www.springsource.org/ldap" class="external-link" rel="nofollow">Spring LDAP</a>.</p>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt>
for this component:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;dependency&gt;</span>
    <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span
class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>camel-spring-ldap<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>x.x.x<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- use the same
version as your Camel core version --&gt;</span></span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>

<h3><a name="SpringLDAP-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
spring-ldap:springLdapTemplate[?options]
</pre>
</div></div>
<p>Where <b>springLdapTemplate</b> is the name of the <a href="http://static.springsource.org/spring-ldap/site/apidocs/org/springframework/ldap/core/LdapTemplate.html"
class="external-link" rel="nofollow">Spring LDAP Template bean</a>. In this bean,
you configure the URL and the credentials for your LDAP access.</p>

<h3><a name="SpringLDAP-Options"></a>Options</h3>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>operation</tt> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> The LDAP operation to be performed. Must be one of <tt>search</tt>,
<tt>bind</tt>, or <tt>unbind</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>scope</tt> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> The scope of the search operation. Must be one of <tt>object</tt>,
<tt>onelevel</tt>, or <tt>subtree</tt>, see also <a href="http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol#Search_and_Compare"
class="external-link" rel="nofollow">http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol#Search_and_Compare</a>
</td>
</tr>
</tbody></table>
</div>
</div>
<p>If an unsupported value is specified for some option, the component throws an <tt>UnsupportedOperationException</tt>.</p>

<h3><a name="SpringLDAP-Usage"></a>Usage</h3>

<p>The component supports producer endpoint only. An attempt to create a consumer endpoint
will result in an <tt>UnsupportedOperationException</tt>.<br/>
The body of the message must be a map (an instance of <tt>java.util.Map</tt>).
This map must contain at least an entry with the key <b><tt>dn</tt></b>
that specifies the root node for the LDAP operation to be performed. Other entries of the
map are operation-specific (see below).</p>

<p>The body of the message remains unchanged for the <tt>bind</tt> and <tt>unbind</tt>
operations. For the <tt>search</tt> operation, the body is set to the result of
the search, see <a href="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"
class="external-link" rel="nofollow">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</a>.</p>

<h4><a name="SpringLDAP-Search"></a>Search</h4>

<p>The message body must have an entry with the key <b><tt>filter</tt></b>.
The value must be a String representing a valid LDAP filter, see <a href="http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol#Search_and_Compare"
class="external-link" rel="nofollow">http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol#Search_and_Compare</a>.</p>

<h4><a name="SpringLDAP-Bind"></a>Bind</h4>

<p>The message body must have an entry with the key <b><tt>attributes</tt></b>.
The value must be an instance of <a href="http://docs.oracle.com/javase/6/docs/api/javax/naming/directory/Attributes.html"
class="external-link" rel="nofollow">javax.naming.directory.Attributes</a> This entry
specifies the LDAP node to be created.</p>

<h4><a name="SpringLDAP-Unbind"></a>Unbind</h4>

<p>No further entries necessary, the node with the specified <b><tt>dn</tt></b>
is deleted.</p>

<p><b>Key definitions</b></p>

<p>In order to avoid spelling errors, the following constants are defined in <tt>org.apache.camel.springldap.SpringLdapProducer</tt>:</p>
<ul>
	<li>public static final String DN = "dn"</li>
	<li>public static final String FILTER = "filter"</li>
	<li>public static final String ATTRIBUTES = "attributes"</li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Spring+LDAP">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=30754230&revisedVersion=9&originalVersion=8">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Spring+LDAP?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message