Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 6222 invoked from network); 25 Mar 2010 22:13:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Mar 2010 22:13:13 -0000 Received: (qmail 591 invoked by uid 500); 25 Mar 2010 22:13:13 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 546 invoked by uid 500); 25 Mar 2010 22:13:13 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 539 invoked by uid 99); 25 Mar 2010 22:13:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Mar 2010 22:13:13 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [81.169.146.162] (HELO mo-p00-ob.rzone.de) (81.169.146.162) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Mar 2010 22:13:05 +0000 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1269555165; l=1465; s=domk; d=labeo.de; h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=E0oezNf5XuyZv0tGmH9cJz8FAUI=; b=yOS3fR3rM05q3hdIv92c8WyBsLKlOwIu4ki0TsPNS17BSeeO+2IxyW84nesiHSPk3wz 8hWTERwqKrTb92ZnL8jQc4j5lVoq0fajQlM/9GzEDI+V4P+O6CtsO4Z1dMUHPQ22ZnWme qOfL1nKiuKa4wmVDbCPDVlPIFp2Grrzvnd8= X-RZG-AUTH: :P3gBc0GmW/MphhhpU4BSj2bmx/Zwgz97J2mNwJqPPUEe1kVAlST/gJi5OKgN X-RZG-CLASS-ID: mo00 Received: from [127.0.0.1] ([80.187.216.102]) by post.strato.de (klopstock mo37) (RZmta 23.0) with ESMTP id 400454m2PKQsIr for ; Thu, 25 Mar 2010 23:12:44 +0100 (MET) Message-ID: <4BABDFD3.2050607@labeo.de> Date: Thu, 25 Mar 2010 23:12:35 +0100 From: Stefan Zoerner User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Apache Directory Developers List Subject: Using DirectoryServiceFactory correcty Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I try to update the documentation examples in order to reflect changes in 1.5.6. And I have a question regarding DirectoryServiceFactory. I have started with the custom partition example. Currently, I do the following in order to start an embedded server, which seems to work: DirectoryServiceFactory factory = DefaultDirectoryServiceFactory.DEFAULT; factory.init("default"); DirectoryService directoryService = factory.getDirectoryService(); directoryService.setShutdownHookEnabled(true); HelloWorldPartition helloPartition = new HelloWorldPartition(); helloPartition.setSuffix("ou=helloWorld"); helloPartition.setSchemaManager(directoryService.getSchemaManager()); helloPartition.initialize(); directoryService.addPartition(helloPartition); directoryService.startup(); LdapServer ldapServer = new LdapServer(); ldapServer.setDirectoryService(directoryService); ldapServer.setAllowAnonymousAccess(true); TcpTransport ldapTransport = new TcpTransport(10389); ldapServer.setTransports(ldapTransport); ldapServer.start(); HelloWorldPartition is my custom partition. The use of the factory class seems a little bit complicated to me. Is there an easier way? Is the order of the calls correct? Furthermore I do not know which argument to pass in the init-Method. without this call, I get an NPE later on (no schema manager). But the name seems not be used ... Thanks in advance, StefanZ