directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r717904 - /directory/sandbox/szoerner/helloWorldPartition/src/main/java/org/apache/directory/samples/partition/hello/HelloWorldPartition.java
Date Sat, 15 Nov 2008 18:17:15 GMT
Author: szoerner
Date: Sat Nov 15 10:17:15 2008
New Revision: 717904

URL: http://svn.apache.org/viewvc?rev=717904&view=rev
Log:
comments added

Modified:
    directory/sandbox/szoerner/helloWorldPartition/src/main/java/org/apache/directory/samples/partition/hello/HelloWorldPartition.java

Modified: directory/sandbox/szoerner/helloWorldPartition/src/main/java/org/apache/directory/samples/partition/hello/HelloWorldPartition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/helloWorldPartition/src/main/java/org/apache/directory/samples/partition/hello/HelloWorldPartition.java?rev=717904&r1=717903&r2=717904&view=diff
==============================================================================
--- directory/sandbox/szoerner/helloWorldPartition/src/main/java/org/apache/directory/samples/partition/hello/HelloWorldPartition.java
(original)
+++ directory/sandbox/szoerner/helloWorldPartition/src/main/java/org/apache/directory/samples/partition/hello/HelloWorldPartition.java
Sat Nov 15 10:17:15 2008
@@ -53,7 +53,6 @@
  * A minimal partition. It is readonly and contains only one entry.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev: 663827 $, $Date: 2008-06-06 07:38:03 +0200 (Fr, 06 Jun 2008) $
  */
 public class HelloWorldPartition implements Partition {
 
@@ -68,7 +67,7 @@
 
     private int cacheSize;
 
-    private String suffix;
+    private String suffix = "ou=hello";
 
     private LdapDN suffixDn;
 
@@ -81,7 +80,7 @@
         String infoMsg = String.format("Initializing %s with suffix %s", this
                 .getClass().getSimpleName(), this.suffix);
         LOG.info(infoMsg);
-        
+                
         this.directoryService = core;
 
         // Create LDAP DN
@@ -96,7 +95,7 @@
         entry.put(SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC,
                 SchemaConstants.ORGANIZATIONAL_UNIT_OC);        
         entry.put(SchemaConstants.OU_AT, rdn.getUpValue().toString());
-        entry.put("description", "Hello World. A very simple partition");
+        entry.put("description", "hello, world", "a minimal partition");
         
         this.helloEntry = entry;
 
@@ -119,8 +118,6 @@
         return new LdapDN(suffix);
     }
 
-
-
     public boolean hasEntry(EntryOperationContext ctx) {
         return ctx.getDn().equals(this.suffixDn);
     }
@@ -171,7 +168,13 @@
         return suffix;
     }
 
+    /**
+     * @throws IllegalArgumentException if suffix does not start with ou=
+     */
     public void setSuffix(String suffix) {
+        if (! suffix.startsWith("ou=")) {           
+            throw new IllegalArgumentException("suffix has to start with ou");
+        }
         this.suffix = suffix;
     }
 



Mime
View raw message