Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 77081 invoked from network); 15 Mar 2007 19:48:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Mar 2007 19:48:41 -0000 Received: (qmail 16462 invoked by uid 500); 15 Mar 2007 19:48:48 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 16426 invoked by uid 500); 15 Mar 2007 19:48:48 -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 16415 invoked by uid 99); 15 Mar 2007 19:48:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 12:48:48 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of akarasulu@gmail.com designates 66.249.82.233 as permitted sender) Received: from [66.249.82.233] (HELO wx-out-0506.google.com) (66.249.82.233) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2007 12:48:37 -0700 Received: by wx-out-0506.google.com with SMTP id h31so314009wxd for ; Thu, 15 Mar 2007 12:48:16 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=cHa/3UWGRpEmTcNfV7kK36CnyMiGZIKBmyEwOO5nPhDsrgE7BTTtnxcQWIONi8uRpaaVSo2dBSkjNxlPctXf+uRpwh5rt3QLqxS7E4MLyNeSHjcALBNfVfS1Kadu7ECn4dA+csSY/mYcZdpWJTN5JE5odBt8+vTkty07l6igb7M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=iV9rM1wONaBxMu0N0cSz0GogZuDnge6htjrS9ZppZah9E2yfw6UD/jw3RqItkOz5mukbztSVoX/7R00nvw45yKIYNTMlWwPX0Kv1yJCUCCS9PxH+astmqx6oGznmBjT/rZjVnIWHodAflC449Ke5KcvNu96dPsHDp8B2QU2kA58= Received: by 10.70.29.14 with SMTP id c14mr1707717wxc.1173988096495; Thu, 15 Mar 2007 12:48:16 -0700 (PDT) Received: by 10.70.78.18 with HTTP; Thu, 15 Mar 2007 12:48:16 -0700 (PDT) Message-ID: Date: Thu, 15 Mar 2007 15:48:16 -0400 From: "Alex Karasulu" Sender: akarasulu@gmail.com To: "Apache Directory Developers List" , erodriguez@apache.org Subject: Re: [core] Best way to add subcontext to partition In-Reply-To: <568753d90703132057i4457415fw748f5576cef99ffb@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_33449_9494493.1173988096442" References: <568753d90703132057i4457415fw748f5576cef99ffb@mail.gmail.com> X-Google-Sender-Auth: 6da72a9724879092 X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_33449_9494493.1173988096442 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 3/13/07, Enrique Rodriguez wrote: > > Hi, Directory developers, > > What's the best way to add a subcontext under a new partition? The > use case would be in an integration test, if I want to create > partition "dc=example,dc=com" and then I want to create "ou=users" > underneath that. Is the only way to create the partition, then use > CoreContextFactory on that partition, then add a subcontext? Or can I > programmatically add a subcontext directly to a partition somehow? The server was designed to use JNDI as the API to perform CRUD operations on entires to reduce the learning curve with custom API's that we would devise. However there is a means to load entries into the server using convenience methods on the unit test classes. You can also refer to an LDIF in your project's respective resources area to be loaded after startup in the setUp() method. Is this what you're looking for? The issue I'm running into is that the Kerberos protocol provider > wants its base DN for principal searches to exist when it starts up > using AbstractServerTest, for example if the base DN is > "ou=users,dc=example,dc=com". I would create "dc=example,dc=com" as > the 'example' partition. Then I need to add the "ou=users" > subcontext. Ahhh I see. In this case you can use the LDIF loading facility built into the server which will load an LDIF before starting the other services. If you remember we created this specifically for this chicken and egg problem that you have with the Krb5 service. Of course, the answer may be to modify the Kerberos provider to > lazy-load the store. On the first authentication request, it would > then go look for the base DN. Something similar will need to happen > for multi-realm capability, anyway. Hmmm I see what you're saying but I think the LDIF loading mechanism will work for you. This is what we do with the default LDIF file that ships with the server. Take a look at these methods: MutableStartupConfiguration.setTestEntries() MutableServerStartupConfiguration.setLdifDirectory() The first will load entries programmatically. The second will load the LDIF files from a directory. HTH, Alex ------=_Part_33449_9494493.1173988096442 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
On 3/13/07, Enrique Rodriguez <enriquer9@gmail.com> wrote:
Hi, Directory developers,

What's the best way to add a subcontext under a new partition?  The
use case would be in an integration test, if I want to create
partition "dc=example,dc=com" and then I want to create "ou=users"
underneath that.  Is the only way to create the partition, then use
CoreContextFactory on that partition, then add a subcontext?  Or can I
programmatically add a subcontext directly to a partition somehow?
 
The server was designed to use JNDI as the API to perform CRUD operations
on entires to reduce the learning curve with custom API's that we would devise.
 
However there is a means to load entries into the server using convenience
methods on the unit test classes.  You can also refer to an LDIF in your
project's respective resources area to be loaded after startup in the setUp()
method.  Is this what you're looking for?

The issue I'm running into is that the Kerberos protocol provider
wants its base DN for principal searches to exist when it starts up
using AbstractServerTest, for example if the base DN is
"ou=users,dc=example,dc=com".  I would create "dc=example,dc=com" as
the 'example' partition.  Then I need to add the "ou=users"
subcontext.
 
Ahhh I see.  In this case you can use the LDIF loading facility built into the
server which will load an LDIF before starting the other services.  If you remember
we created this specifically for this chicken and egg problem that you have with
the Krb5 service.

Of course, the answer may be to modify the Kerberos provider to
lazy-load the store.  On the first authentication request, it would
then go look for the base DN.  Something similar will need to happen
for multi-realm capability, anyway.
 
Hmmm I see what you're saying but I think the LDIF loading mechanism will
work for you.  This is what we do with the default LDIF file that ships with the
server.  Take a look at these methods:
 
MutableStartupConfiguration.setTestEntries()
MutableServerStartupConfiguration.setLdifDirectory()
 
The first will load entries programmatically.  The second will load the LDIF files from a directory. 
 
HTH,
Alex
 
 

 

------=_Part_33449_9494493.1173988096442--