directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r871777 - in /websites/staging/directory/trunk/content: ./ api/user-guide/6-ldap-data-structures.html api/user-guide/6.1-administrative-point.html api/user-guide/6.12-entry.html
Date Mon, 29 Jul 2013 23:05:54 GMT
Author: buildbot
Date: Mon Jul 29 23:05:54 2013
New Revision: 871777

Log:
Staging update by buildbot for directory

Added:
    websites/staging/directory/trunk/content/api/user-guide/6.1-administrative-point.html
    websites/staging/directory/trunk/content/api/user-guide/6.12-entry.html
Modified:
    websites/staging/directory/trunk/content/   (props changed)
    websites/staging/directory/trunk/content/api/user-guide/6-ldap-data-structures.html

Propchange: websites/staging/directory/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Jul 29 23:05:54 2013
@@ -1 +1 @@
-1508223
+1508227

Modified: websites/staging/directory/trunk/content/api/user-guide/6-ldap-data-structures.html
==============================================================================
--- websites/staging/directory/trunk/content/api/user-guide/6-ldap-data-structures.html (original)
+++ websites/staging/directory/trunk/content/api/user-guide/6-ldap-data-structures.html Mon Jul 29 23:05:54 2013
@@ -140,7 +140,7 @@
 <h1 id="6-ldap-data-structures">6 - LDAP Data Structures (...)</h1>
 <h2 id="contents">Contents</h2>
 <ul>
-<li><a href="6.1-administrative-point.html">6.1 - AdministrativePoint (e)</a></li>
+<li><a href="6.1-administrative-point.html">6.1 - AdministrativePoint (...)</a></li>
 <li><a href="6.2-administrative-role.html">6.2 - AdministrativeRole (e)</a></li>
 <li><a href="6.3-attribute.html">6.3 - Attribute</a></li>
 <li><a href="6.4-attribute-type.html">6.4 - AttributeType (...)</a></li>

Added: websites/staging/directory/trunk/content/api/user-guide/6.1-administrative-point.html
==============================================================================
--- websites/staging/directory/trunk/content/api/user-guide/6.1-administrative-point.html (added)
+++ websites/staging/directory/trunk/content/api/user-guide/6.1-administrative-point.html Mon Jul 29 23:05:54 2013
@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+	<head>
+		<title>6.1 - AdministrativePoint &mdash; Apache Directory</title>
+		
+	    <link href="./../../css/common.css" rel="stylesheet" type="text/css">
+	    <link href="./../../css/brown.css" rel="stylesheet" type="text/css">
+    
+        
+        <link rel="shortcut icon" href="./../../images/api-icon_16x16.png">
+    
+        <!-- Google Analytics -->
+        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+        <script type="text/javascript">
+            _uacct = "UA-1358462-1";
+            urchinTracker();
+        </script>
+	</head>
+	<body>
+	    <div id="container">
+            <div id="header">
+                <div id="subProjectsNavBar">
+                    <a href="./../../">
+                        
+                        Apache Directory Project
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../apacheds">
+                        
+                        ApacheDS
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../studio">
+                        
+                        Apache Directory Studio
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../api">
+                        
+                        <STRONG>Apache LDAP API</STRONG>
+                        
+                    </a>
+                </div><!-- subProjectsNavBar -->
+            </div><!-- header -->
+            <div id="content">
+                <div id="leftColumn">
+                    
+<div id="navigation">
+    
+    <h5>Downloads</h5>
+    <ul>
+	    <li><a href="./../../api/downloads.html">Version 1.0.0-M19</a>&nbsp;&nbsp;<IMG src="./../../images/new_badge.gif" alt="" style="margin-bottom:-3px;" border="0"></li>
+        <li><a href="./../../api/download-old-versions.html">Older versions</a></li>
+    </ul>
+    <h5>Getting Started</h5>
+    <ul>
+        <li><a href="./../../api/vision.html">Vision</a></li>
+        <li><a href="./../../api/java-api.html">Java API</a></li>
+        <li><a href="./../../api/groovy-ldap.html">Groovy API</a></li>
+    </ul>
+    <h5>Documentation</h5>
+    <ul>
+	    <li><a href="./../../api/five-minutes-tutorial.html">Five minutes tutorial</a></li>
+	    <li><a href="./../../api/user-guide.html">User Guide</a></li>
+        <li><a href="./../../api/gen-docs/latest/apidocs/">JavaDocs</a></li>
+        <!--li><a href="./../../api/gen-docs/latest/">Generated Reports</a></li-->
+        <li><a href="./../../api/developer-guide.html">Developer Guide</a></li>
+    </ul>
+    
+    
+    <h5>Support</h5>
+    <ul>
+        <li><a href="./../../mailing-lists-and-irc.html">Mailing Lists &amp; IRC</a></li>
+        <li><a href="./../../sources.html">Sources</a></li>
+        <li><a href="./../../issue-tracking.html">Issue Tracking</a></li>
+        <li><a href="./../../commercial-support.html">Commercial Support</a></li>
+    </ul>
+    <h5>Community</h5>
+    <ul>
+        <li><a href="./../../contribute.html">How to Contribute</a></li>
+        <li><a href="./../../team.html">Team</a></li>
+        <li><a href="./../../original-project-proposal.html">Original Project Proposal</a></li>
+        <li><a href="./../../special-thanks.html" class="external-link" rel="nofollow">Special Thanks</a></li>
+    </ul>
+    <h5>About Apache</h5>
+    <ul>
+        <li><a href="http://www.apache.org/">Apache</a></li>
+        <li><a href="http://www.apache.org/licenses/">License</a></li>
+        <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+        <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+        <li><a href="http://www.apache.org/security/">Security</a></li>
+    </ul>
+    <a href="http://ldapcon.org" target="_blank" rel="nofollow"><img src="./../../images/banner-ldapcon-2013.png" alt="LDAPCon 2013" width="167" height="231"></a>
+    
+</div><!-- navigation -->
+
+                </div><!-- leftColumn -->
+                <div id="rightColumn">
+
+
+    <div class="nav">
+        <div class="nav_prev">
+        
+            <a href="6-ldap-data-structures.html">6 - LDAP data structures</a>
+		
+        </div>
+        <div class="nav_up">
+        
+            <a href="6-ldap-data-structures.html">6 - LDAP data structures</a>
+		
+        </div>
+        <div class="nav_next">
+        
+            <a href="6.2-administrative-role.html">6.2 - AdministrativeRole</a>
+		
+        </div>
+        <div class="clearfix"></div>
+    </div>
+
+
+<h1 id="61-administrativepoint">6.1 - AdministrativePoint</h1>
+<p>And <em>AdministrativePoint</em> is a position in the <em>DIT</em> which is controled by some administrative role.</p>
+
+
+    <div class="nav">
+        <div class="nav_prev">
+        
+            <a href="6-ldap-data-structures.html">6 - LDAP data structures</a>
+		
+        </div>
+        <div class="nav_up">
+        
+            <a href="6-ldap-data-structures.html">6 - LDAP data structures</a>
+		
+        </div>
+        <div class="nav_next">
+        
+            <a href="6.2-administrative-role.html">6.2 - AdministrativeRole</a>
+		
+        </div>
+        <div class="clearfix"></div>
+    </div>
+
+
+                </div><!-- rightColumn -->
+                <div id="endContent"></div>
+            </div><!-- content -->
+            <div id="footer">&copy; 2003-2012, <a href="http://www.apache.org">The Apache Software Foundation</a> - <a href="./../../privacy-policy.html">Privacy Policy</a><br />
+                Apache Directory, ApacheDS, Apache Directory Server, Apache Directory Studio, Apache LDAP API, Apache Triplesec, Triplesec, Apache, the Apache feather logo, and the Apache Directory project logos are trademarks of The Apache Software Foundation.
+            </div>
+        </div><!-- container -->
+    </body>
+</html>
\ No newline at end of file

Added: websites/staging/directory/trunk/content/api/user-guide/6.12-entry.html
==============================================================================
--- websites/staging/directory/trunk/content/api/user-guide/6.12-entry.html (added)
+++ websites/staging/directory/trunk/content/api/user-guide/6.12-entry.html Mon Jul 29 23:05:54 2013
@@ -0,0 +1,717 @@
+<!DOCTYPE html>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+	<head>
+		<title>6.12 - Entry &mdash; Apache Directory</title>
+		
+	    <link href="./../../css/common.css" rel="stylesheet" type="text/css">
+	    <link href="./../../css/brown.css" rel="stylesheet" type="text/css">
+    
+        
+        <link rel="shortcut icon" href="./../../images/api-icon_16x16.png">
+    
+        <!-- Google Analytics -->
+        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+        <script type="text/javascript">
+            _uacct = "UA-1358462-1";
+            urchinTracker();
+        </script>
+	</head>
+	<body>
+	    <div id="container">
+            <div id="header">
+                <div id="subProjectsNavBar">
+                    <a href="./../../">
+                        
+                        Apache Directory Project
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../apacheds">
+                        
+                        ApacheDS
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../studio">
+                        
+                        Apache Directory Studio
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../api">
+                        
+                        <STRONG>Apache LDAP API</STRONG>
+                        
+                    </a>
+                </div><!-- subProjectsNavBar -->
+            </div><!-- header -->
+            <div id="content">
+                <div id="leftColumn">
+                    
+<div id="navigation">
+    
+    <h5>Downloads</h5>
+    <ul>
+	    <li><a href="./../../api/downloads.html">Version 1.0.0-M19</a>&nbsp;&nbsp;<IMG src="./../../images/new_badge.gif" alt="" style="margin-bottom:-3px;" border="0"></li>
+        <li><a href="./../../api/download-old-versions.html">Older versions</a></li>
+    </ul>
+    <h5>Getting Started</h5>
+    <ul>
+        <li><a href="./../../api/vision.html">Vision</a></li>
+        <li><a href="./../../api/java-api.html">Java API</a></li>
+        <li><a href="./../../api/groovy-ldap.html">Groovy API</a></li>
+    </ul>
+    <h5>Documentation</h5>
+    <ul>
+	    <li><a href="./../../api/five-minutes-tutorial.html">Five minutes tutorial</a></li>
+	    <li><a href="./../../api/user-guide.html">User Guide</a></li>
+        <li><a href="./../../api/gen-docs/latest/apidocs/">JavaDocs</a></li>
+        <!--li><a href="./../../api/gen-docs/latest/">Generated Reports</a></li-->
+        <li><a href="./../../api/developer-guide.html">Developer Guide</a></li>
+    </ul>
+    
+    
+    <h5>Support</h5>
+    <ul>
+        <li><a href="./../../mailing-lists-and-irc.html">Mailing Lists &amp; IRC</a></li>
+        <li><a href="./../../sources.html">Sources</a></li>
+        <li><a href="./../../issue-tracking.html">Issue Tracking</a></li>
+        <li><a href="./../../commercial-support.html">Commercial Support</a></li>
+    </ul>
+    <h5>Community</h5>
+    <ul>
+        <li><a href="./../../contribute.html">How to Contribute</a></li>
+        <li><a href="./../../team.html">Team</a></li>
+        <li><a href="./../../original-project-proposal.html">Original Project Proposal</a></li>
+        <li><a href="./../../special-thanks.html" class="external-link" rel="nofollow">Special Thanks</a></li>
+    </ul>
+    <h5>About Apache</h5>
+    <ul>
+        <li><a href="http://www.apache.org/">Apache</a></li>
+        <li><a href="http://www.apache.org/licenses/">License</a></li>
+        <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+        <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+        <li><a href="http://www.apache.org/security/">Security</a></li>
+    </ul>
+    <a href="http://ldapcon.org" target="_blank" rel="nofollow"><img src="./../../images/banner-ldapcon-2013.png" alt="LDAPCon 2013" width="167" height="231"></a>
+    
+</div><!-- navigation -->
+
+                </div><!-- leftColumn -->
+                <div id="rightColumn">
+
+
+    <div class="nav">
+        <div class="nav_prev">
+        
+            <a href="6.11-dit-structure-rule.html">6.11 - DITStructureRule</a>
+		
+        </div>
+        <div class="nav_up">
+        
+            <a href="6-ldap-data-structures.html">6 - LDAP data structures</a>
+		
+        </div>
+        <div class="nav_next">
+        
+            <a href="6.13-expr-node.html">6.13 - ExprNode</a>
+		
+        </div>
+        <div class="clearfix"></div>
+    </div>
+
+
+<h1 id="612-entry">6.12 - Entry</h1>
+<p>The <em>Entry</em> class is one of the most important one in the <em>API</em>. It describes the base element stored into a <em>LDAP</em> server, and it associates a <em>Dn</em> and some <em>Attributes</em>.</p>
+<p>We have two kinds of <em>Entry</em> in the <em>API</em>, depending on the presence of a <em>SchemaManager</em> in the <em>Entry</em>, or not.</p>
+<p>We also provide a few extended classes, like the <em>ImmutableEntry</em>, an immutable version of the <em>Entry</em>.</p>
+<h2 id="creating-an-entry">Creating an Entry</h2>
+<p>We have many ways to create an <em>Entry</em>. Basically, an <em>Entry</em> has a <em>Dn</em> and some <em>Attributes</em>. It can be schema aware, or not. We provide constructors to allow a user to create the kind of <em>Entry</em> he wants.</p>
+<p>The simplest way to create an <em>Entry</em> is to call the default constructor. The created entry will have no attributes, and no Dn. We can also make it schema aware by passing a <em>SchemaManager</em>. Here is an example:</p>
+<div class="codehilite"><pre><span class="nd">@Test</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEmptyEntry</span><span class="o">()</span>
+<span class="o">{</span>
+    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">();</span>
+
+    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">Dn</span><span class="o">.</span><span class="na">EMPTY_DN</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="mi">0</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">size</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">isSchemaAware</span><span class="o">()</span> <span class="o">);</span>
+
+    <span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">);</span>
+
+    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">Dn</span><span class="o">.</span><span class="na">EMPTY_DN</span><span class="o">,</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="mi">0</span><span class="o">,</span> <span class="n">entry2</span><span class="o">.</span><span class="na">size</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">isSchemaAware</span><span class="o">()</span> <span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>You can also create an <em>Entry</em> passing a <em>Dn</em>, but no attribute. We can create schema aware entries this way too, passing a <em>SchemaManager</em>.</p>
+<div class="codehilite"><pre><span class="nd">@Test</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryWithDn</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
+<span class="o">{</span>
+    <span class="n">Dn</span> <span class="n">dn</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Dn</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;DomainComponent=example, dc=COM&quot;</span> <span class="o">);</span>
+    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
+
+    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">().</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="mi">0</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">size</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">isSchemaAware</span><span class="o">()</span> <span class="o">);</span>
+
+    <span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
+
+    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">dn</span><span class="o">,</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="mi">0</span><span class="o">,</span> <span class="n">entry2</span><span class="o">.</span><span class="na">size</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">isSchemaAware</span><span class="o">()</span> <span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>We can also create an entry by copying an existing entry. The created <em>Entry</em> must be schema aware. Here is an example:</p>
+<div class="codehilite"><pre><span class="nd">@Test</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryCopy</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
+<span class="o">{</span>
+    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atCn</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atSn</span><span class="o">,</span> <span class="s">&quot;Test&quot;</span> <span class="o">);</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atObjectClass</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">);</span>
+
+    <span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="n">entry</span> <span class="o">);</span>
+
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">(),</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+
+    <span class="n">entry</span><span class="o">.</span><span class="na">clear</span><span class="o">();</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="n">atCn</span><span class="o">,</span> <span class="s">&quot;TEST&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="n">atSn</span><span class="o">,</span> <span class="s">&quot;TEST&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="n">atObjectClass</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">)</span> <span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Last, not least, it's possible to create an <em>Entry</em> using a list of LDIF formated attributes. An example worth ten lines of documentation, so let's see what it means.</p>
+<p>First, we will create a schema agnostic entry:</p>
+<div class="codehilite"><pre><span class="nd">@Test</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryLdif</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">Exception</span>
+<span class="o">{</span>
+    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+        <span class="s">&quot;cn: test&quot;</span><span class="o">,</span>
+        <span class="s">&quot;sn: test&quot;</span>
+        <span class="o">);</span>
+
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">().</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">)</span> <span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>We can also provide a complete LDIF file (except that we can't add the <em>dn</em>):</p>
+<div class="codehilite"><pre><span class="nd">@Test</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryLdifComplete</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">Exception</span>
+<span class="o">{</span>
+    <span class="n">String</span> <span class="n">ldif</span> <span class="o">=</span>
+        <span class="s">&quot;objectClass: top\n&quot;</span> <span class="o">+</span>           <span class="c1">// The \n is mandatory.</span>
+        <span class="s">&quot;objectClass: person\n&quot;</span> <span class="o">+</span>
+        <span class="s">&quot;cn: test\n&quot;</span> <span class="o">+</span>
+        <span class="s">&quot;sn: test&quot;</span><span class="o">;</span>
+
+    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">ldif</span> <span class="o">);</span>
+
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">().</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">)</span> <span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>One can also combine LDIF and variables like in this example (note that if you use a variable, the attribute must not be followed by the <em>':'</em> char):</p>
+<div class="codehilite"><pre><span class="nd">@Test</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryLdif2</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">Exception</span>
+<span class="o">{</span>
+    <span class="n">String</span> <span class="n">name</span> <span class="o">=</span> <span class="s">&quot;test&quot;</span><span class="o">;</span>
+    <span class="n">String</span> <span class="n">surname</span> <span class="o">=</span> <span class="s">&quot;test&quot;</span><span class="o">;</span>
+
+    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+        <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="n">name</span><span class="o">,</span>             <span class="c1">// No &#39;:&#39;</span>
+        <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="n">surname</span>
+        <span class="o">);</span>
+
+    <span class="n">assertEquals</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">().</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">)</span> <span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h2 id="modifying-an-entry">Modifying an Entry</h2>
+<p>We have four methods available that modify the <em>Entry</em> content : <em>add</em>, <em>remove</em>, <em>put</em> and <em>set</em>. We will review those four methods in the following paragraphs.</p>
+<h3 id="adding-attributes">Adding Attributes</h3>
+<p>Two methods can be used to add some attribute into an <em>Entry</em>, depending on the fact that we will add some value without replacing an existing attribute with the same name (and we use the <em>add</em> method for that), or replace it with a new attribute (and we use the <em>put</em> method for that).</p>
+<p>In any case, we can add either an empty attribute, or an attribute with some values. Those values can be <em>Strings</em>, <em>byte[]</em> or <em>Values</em>. The added attributes can be schema aware, and we can also provide a user provided name for the attribute type.</p>
+<h5 id="add-methods">add() methods</h5>
+<p>The first method makes it possible to add some existing <em>Attribute</em> to an <em>Entry</em>. Let's see how it works:</p>
+<div class="codehilite"><pre><span class="nd">@Test</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testEntryAddAttribute</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
+<span class="o">{</span>
+    <span class="n">Attribute</span> <span class="n">cn</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
+    <span class="n">Attribute</span> <span class="n">cn2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">);</span>
+
+    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+        <span class="s">&quot;sn: test&quot;</span> <span class="o">);</span>
+
+    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
+
+    <span class="c1">// Add the new attribute</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">cn</span> <span class="o">);</span>
+
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+
+    <span class="c1">// Try to add a second value</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">cn2</span> <span class="o">);</span>
+
+    <span class="c1">// Both values must be present</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">)</span> <span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Otherwise, we can add a new attribute and values into the <em>Entry</em> by passing both parameters. We can also pass an <em>AttributeType</em> to the <em>add()</em> method, making the added attribute schema aware. Note that if the <em>Entry</em> itself is already schema aware, this is not necessary.</p>
+<p>Here are some examples, the first one with a schema aware <em>Entry</em>, the second one with a schema agnostic <em>Entry</em>:</p>
+<div class="codehilite"><pre><span class="nd">@Test</span>
+<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testEntryAddAtValue</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
+<span class="o">{</span>
+    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+        <span class="n">schemaManager</span><span class="o">,</span>
+        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+        <span class="s">&quot;sn: test&quot;</span> <span class="o">);</span>
+
+    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
+
+    <span class="c1">// Add the new attribute</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
+
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;CN&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+
+    <span class="c1">// Try to add a second value</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atCn</span><span class="o">,</span> <span class="s">&quot;A  second test   &quot;</span> <span class="o">);</span>
+
+    <span class="c1">// Both values must be present</span>
+    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span><span class="o">,</span> <span class="s">&quot;a second test&quot;</span> <span class="o">)</span> <span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<DIV class="" 
+{note:title=Warning !}
+When manipulating a schema agnostic *Entry*, do not expect that the attribute type will be recognized if you inject schema aware attributes.
+</DIV>
+
+    :::Java
+    @Test
+    public void testEntryAddAtValue() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            "dc=example, dc=com",
+            "objectClass: top",
+            "objectClass: person",
+            "sn: test" );
+
+        assertFalse( entry.containsAttribute( "cn" ) );
+
+        // Add the new attribute
+        entry.add( "cn", "test" );
+
+        assertTrue( entry.contains( "cn", "test" ) );
+
+        // Try to add a second value
+        entry.add( atCn, "A  second  test" );
+
+        // Both values must be present
+        assertTrue( entry.contains( "cn", "test" ) );
+        assertTrue( entry.contains( "2.5.4.3", "a second test" ) );
+        assertFalse( entry.contains( "cn", "A  second  test" ) );
+    }
+
+##### put() methods
+
+The big difference with the _add_ method is that the attribute is not added, it will replace an existing one. let's see with an example :
+
+    :::Java
+    @Test
+    public void testEntryPutAttribute() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            schemaManager, 
+            "dc=example, dc=com",
+            "objectClass: top",
+            "objectClass: person",
+            "sn: test" );
+
+        assertFalse( entry.containsAttribute( "cn" ) );
+
+        // Add the new attribute
+        entry.put( "cn", "test" );
+
+        assertTrue( entry.contains( "cn", "test" ) );
+
+        // Try to add a second value
+        entry.put( "cn", "test2" );
+
+        // Both values must be present
+        assertFalse( entry.contains( "cn", "test", "test2" ) );
+        assertFalse( entry.contains( "cn", "test" ) );
+        assertTrue( entry.contains( "cn", "test2" ) );
+    }
+
+### Removing Attributes
+
+We can remove either an attribute having a specific value, or an entire attribute. In order to remove a complete attribute, you just have to provide the attribute's name, and use the _removeAttributes_ method.
+
+Here are some example for both usages :
+
+    :::Java
+    @Test
+    public void testRemoveAttribute() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            schemaManager,
+            "dc=example, dc=com",
+            "objectClass: top",
+            "objectClass: person",
+            "sn: test",
+            "cn: test1",
+            "cn: test2",
+            "cn: test3" );
+
+        assertTrue( entry.contains( "cn", "test1", "test2", "test3" ) );
+
+        // Remove the "test2" value
+        entry.remove( "cn", "test2" );
+
+        assertTrue( entry.contains( "cn", "test1", "test3" ) );
+        assertFalse( entry.contains( "cn", "test2" ) );
+
+        // Try to remove the full attribute
+        entry.removeAttributes( "cn" );
+
+        assertFalse( entry.containsAttribute( "cn" ) );
+    }
+
+#### Storing a Dn
+
+It's also possible to store a new _Dn_ into the Entry, using the _setDn() method. It will replace an existing _Dn_ This method takes either a _Dn_ instance, or a _String_.
+
+## Attribute data access methods
+
+The *API* provides convenient methods to access the *Entry* content, and to check if it contains some attributes or some values. We will shortly expose those methods in the following paragraphs.
+
+### Contains method
+The _contains_ and _containsAttributes_ methods check that the *Entry* contain a couple of <attributeType/values> for the first set of methods, and for the existence of a specific attribute for the second method.
+
+One can check for the existence of a specific value for a given attribute, or even for multiple values for a specific attribute. Let's see the _contains_ method in action:
+
+    :::Java
+    @Test
+    public void testContains() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            schemaManager,
+            "dc=example, dc=com",
+            "objectClass: top",
+            "objectClass: person",
+            "sn: test",
+            "cn: test1",
+            "cn: test2",
+            "cn: test3" );
+
+        assertTrue( entry.containsAttribute( "cn", "sn" ) );
+        assertTrue( entry.contains( "cn", "test1", "test2", "test3" ) );
+        assertTrue( entry.contains( "cn", "test1" ) );
+
+        // The value does not exist for the "cn" attribute
+        assertFalse( entry.contains( "cn", "test4" ) );
+    }
+
+#### get(AttributeType) and get(String)
+
+Returns the _Attribute_ having the given name if it exists. The following test demonstrates its usage:
+
+    :::Java
+    @Test
+    public void testGet() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            schemaManager,
+            "dc=example, dc=com",
+            "objectClass: top",
+            "objectClass: person",
+            "sn: test",
+            "cn: test1",
+            "cn: test2",
+            "cn: test3" );
+
+        // With an attribute's name
+        assertNotNull( entry.get( "cn" ) );
+        assertTrue( entry.get( "cn" ).contains( "test1", "test2", "test3" ) );
+
+        // With an AttributeType
+        assertNotNull( entry.get( atSn ) );
+        assertTrue( entry.get( atSn ).contains( "test" ) );
+    }
+
+#### getAttributeTypes()
+
+This method returns the list of _AttributeTypes_ stored into the *Entry*.
+
+{note:title=Be careful !}
+This method is only valuable if the *Entry* is schema aware !
+{note}
+
+Here is an example of usage:
+
+    :::Java
+    @Test
+    public void testGetAttributeTypes() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            schemaManager,
+            "cn=example, dc=com", 
+            "objectClass: top",
+            "objectClass: person",
+            "cn: example",
+            "sn: test"
+            );
+
+        for ( AttributeType attr : entry.getAttributeTypes() )
+        {
+            System.out.println( attr.getName() );
+        }
+    }
+
+This code produces the following output:
+
+    :::Java
+    sn
+    objectClass
+    cn
+
+#### getDn()
+
+This method returns the *Entry*'s _Dn_.
+
+#### hasObjectClass methods
+
+The _hasObjectClass()_ methods are used to discover if an *Entry* has a specific _ObjectClass_. This is a convenient method, as it's possible to do the same thing with a _contains()_ call, but with one less parameter (you don't have to provide the _"ObjectClass"_ as a first parameter).
+
+Here is an example using the two existing methods:
+
+    :::Java
+    @Test
+    public void testHasObjectClass() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            schemaManager,
+            "cn=example, dc=com", 
+            "objectClass: top",
+            "objectClass: person",
+            "cn: example",
+            "sn: test"
+            );
+
+        // Test the presence
+        assertTrue( entry.hasObjectClass( "person", " TOP " ) );
+        assertFalse( entry.hasObjectClass( "domain ", "TOP" ) );
+        assertTrue( entry.hasObjectClass( "Person " ) );
+
+        // Same test, but with Attributes
+        Attribute oc1 = new DefaultAttribute( atObjectClass, "TOP ", "person" );
+        Attribute oc2 = new DefaultAttribute( atObjectClass, "person " );
+        Attribute oc3 = new DefaultAttribute( atObjectClass, "TOP", "domain" );
+
+        assertTrue( entry.hasObjectClass( oc1, oc2 ) );
+        assertFalse( entry.hasObjectClass( oc1, oc3 ) );
+    }
+
+Obviously, dealing with a schema agnostic *Entry*, those methods are more strict. You have to use the exact ObjectClasses case sensitive trimmed names (in the previous example, we can use upper cased names, even with spaces around the names).
+
+Also note that the _hasObjectClass_ method used with _AttributeType_ does not work on a schema agnostic entry.
+
+## Miscellaneous methods
+We also have some other methods which can be used on an *Entry*. Here is a list of those methods.
+
+#### clear()
+This method removes all the added _Attributes_ from this *Entry*. The _Dn_ remains the same.
+
+#### clone()
+Creates a copy of the current *Entry*. All the _Attributes_ are also cloned.
+
+#### iterator()
+Allows an iteration over all the _Attributes_. The following examples shows how this can be used:
+
+    :::Java
+    @Test
+    public void testIterator() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            "cn=example, dc=com", 
+            "objectClass: top",
+            "objectClass: person",
+            "cn: example",
+            "sn: test"
+            );
+
+        for ( Attribute attribute : entry )
+        {
+            System.out.println( "Attribute : \n" + attribute.toString() );
+        }
+    }
+
+This produces the following output:
+
+    :::Java
+    Attribute : 
+        sn: test
+
+    Attribute : 
+        cn: example
+
+    Attribute : 
+        objectclass: top
+        objectclass: person
+
+Note that the _Attribute_ order is not guaranteed.
+
+#### isSchemaAware()
+
+Tells if the ¨*Entry* has an associated _SchemaManager_.
+
+#### size()
+Returns the number of _Attribute_ stored in the *Entry*.
+
+#### equals(Object)
+Check if two *Entries* are equal or not. It's important to understand that depending on whether the entry is schema aware or not, the comparison will be processed differently. Typically, the attribute's name must be equals when they have been trimmed and lower cased if the entry is not schema aware, and we can't compare an attribute named 'cn' with another one named '2.5.4.3' in this case (the *Entry* must be schema aware to allow such comparison). More important, the values *must* be identical (same casing, same spaces) in this case.
+The attribute's values order is irrelevant.
+
+Here are one example with a schema agnostic *Entry*:
+
+    :::Java
+    @Test
+    public void testEntryEquals() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            "dc=example, dc=com",
+            "objectClass: top",
+            "objectClass: person",
+            "sn: test",
+            "cn: test1",
+            "cn: test2",
+            "cn: test3" );
+
+        Entry entry2 = new DefaultEntry( 
+            "dc=example, dc=com",
+            "objectClass: top",
+            "objectClass: person",
+            "sn: test",
+            "cn: test2",
+            "CN: test1",
+            "cn: test3" );
+
+        assertEquals( entry, entry2 );
+    }
+
+and another example with a schema aware *Entry*:
+
+    :::Java
+    @Test
+    public void testSchemaAwayeEntryEquals() throws LdapException
+    {
+        Entry entry = new DefaultEntry( 
+            schemaManager,
+            "dc=example, dc=com",
+            "objectClass: top",
+            "objectClass: person",
+            "sn: test",
+            "cn: test1",
+            "cn: test2",
+            "cn: test3" );
+
+        Entry entry2 = new DefaultEntry( 
+            schemaManager,
+            "dc=example,dc=com",
+            "objectClass: TOP",
+            "objectClass: person",
+            "sn: Test",
+            "cn: Test2",
+            "2.5.4.3: test1",
+            "CommonName: test3" );
+
+        assertEquals( entry, entry2 );
+    }
+
+
+    <div class="nav">
+        <div class="nav_prev">
+        
+            <a href="6.11-dit-structure-rule.html">6.11 - DITStructureRule</a>
+		
+        </div>
+        <div class="nav_up">
+        
+            <a href="6-ldap-data-structures.html">6 - LDAP data structures</a>
+		
+        </div>
+        <div class="nav_next">
+        
+            <a href="6.13-expr-node.html">6.13 - ExprNode</a>
+		
+        </div>
+        <div class="clearfix"></div>
+    </div>
+
+
+                </div><!-- rightColumn -->
+                <div id="endContent"></div>
+            </div><!-- content -->
+            <div id="footer">&copy; 2003-2012, <a href="http://www.apache.org">The Apache Software Foundation</a> - <a href="./../../privacy-policy.html">Privacy Policy</a><br />
+                Apache Directory, ApacheDS, Apache Directory Server, Apache Directory Studio, Apache LDAP API, Apache Triplesec, Triplesec, Apache, the Apache feather logo, and the Apache Directory project logos are trademarks of The Apache Software Foundation.
+            </div>
+        </div><!-- container -->
+    </body>
+</html>
\ No newline at end of file



Mime
View raw message