You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by David Jencks <da...@yahoo.com> on 2007/07/03 01:53:52 UTC

Re: Simplified server configuration with xbean-spring

So does the deafening silence that greeted this mean everyone is so  
awed by this that they are left speechless? :-)

Seriously, does anyone have any comments on this?  Does everyone  
prefer the untyped spring style?

On a related note, I've seen a lot of Mutable****Configuration  
classes in various spots and AFAICT their only purpose is to support  
springs troubles with constructor dependency injection.  I think  
there's a way to use xbean-spring to make the xml style as below fit  
into constructor dependency injection.  Any interest in this, or does  
everyone prefer what's happening now?

thanks
david jencks


On Jun 28, 2007, at 4:17 PM, David Jencks wrote:

> A while back there was some discussion of whether server.xml could  
> be made to be more semantically meaningful with less generic cruft,  
> and I suggested looking into xbean-spring.  So, I spent a bit of  
> time on it and implemented this.  See https://issues.apache.org/ 
> jira/browse/DIRSERVER-984
>
> This was pretty easy to do, after fixing some problems in xbean.   
> Basically all I did was add some javadoc "annotations" to tell  
> xbean which classes to look at and what type collections contain,  
> and change to the xbean application context from the plain spring one.
>
> xbean generates a schema for the configurable objects so you can  
> consult the schema to see what can be configured.  As you can see,  
> you can mix regular spring configuration and the xbean style in the  
> same server.xml.
>
> There's a lot more customization possible, I basically did the  
> minimum possible to get  it to work.  Pretty much anything can have  
> a different name.  The main ugliness I see is the handling of  
> properties that are lists (or sets) of strings.
>
> So, at the risk of posting too large a message,  here's the shiny  
> new server.xml (I removed some commented out bits) :
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>         "http://www.springframework.org/dtd/spring-beans.dtd">
>
> <beans>
> <!-- bean I didn't convert -->
>   <bean id="environment"  
> class="org.springframework.beans.factory.config.PropertiesFactoryBean" 
> >
>     <property name="properties">
>       <props>
>         <!-- JNDI security properties used to get initial  
> contexts.         -->
>         <prop key="java.naming.security.authentication">simple</prop>
>         <prop  
> key="java.naming.security.principal">uid=admin,ou=system</prop>
>         <prop key="java.naming.security.credentials">secret</prop>
>       </props>
>     </property>
>   </bean>
>
>
>   <mutableServerStartupConfiguration id="configuration"  
> xmlns="http://apacheds.org/config/1.0"
>                                      workingDirectory="example.com"
>                                      synchPeriodMillis="5000"
>                                      maxThreads="8"
>                                      allowAnonymousAccess="false"
>                                      accessControlEnabled="false"
>                                      denormalizeOpAttrsEnabled="false"
>           >
>     <ntpConfiguration>
>       <ntpConfiguration
>               enabled="false"
>               ipPort="123">
>       </ntpConfiguration>
>     </ntpConfiguration>
>
>     <dnsConfiguration>
>       <dnsConfiguration
>               enabled="false"
>               ipPort="53">
>       </dnsConfiguration>
>     </dnsConfiguration>
>
>     <changePasswordConfiguration>
>       <changePasswordConfiguration
>               enabled="false"
>               ipPort="464">
>       </changePasswordConfiguration>
>     </changePasswordConfiguration>
>
>     <kdcConfiguration>
>       <kdcConfiguration
>               enabled="false"
>               ipPort="88">
>       </kdcConfiguration>
>     </kdcConfiguration>
>
>     <ldapConfiguration>
>       <ldapConfiguration id="ldapConfiguration"
>               ipPort="10389"
>               allowAnonymousAccess="false"
>               saslHost="ldap.example.com"
>               saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM"
>               searchBaseDn="ou=users,ou=system"
>               maxTimeLimit="15000"
>               maxSizeLimit="1000">
>
>         <!-- The list of supported authentication  
> mechanisms.                   -->
>         <supportedMechanisms>
>           <value xmlns="http://www.springframework.org/schema/ 
> beans">SIMPLE</value>
>           <value xmlns="http://www.springframework.org/schema/ 
> beans">CRAM-MD5</value>
>           <value xmlns="http://www.springframework.org/schema/ 
> beans">DIGEST-MD5</value>
>           <!--<value xmlns="http://www.springframework.org/schema/ 
> beans">GSSAPI</value>-->
>         </supportedMechanisms>
>
>         <!-- The desired quality-of-protection, used by DIGEST-MD5  
> and GSSAPI.  -->
>         <saslQop>
>           <value xmlns="http://www.springframework.org/schema/ 
> beans">auth</value>
>           <value xmlns="http://www.springframework.org/schema/ 
> beans">auth-int</value>
>           <value xmlns="http://www.springframework.org/schema/ 
> beans">auth-conf</value>
>         </saslQop>
>
>         <!-- The realms serviced by this SASL host, used by DIGEST- 
> MD5 and GSSAPI. -->
>         <saslRealms>
>           <value xmlns="http://www.springframework.org/schema/ 
> beans">example.com</value>
>           <value xmlns="http://www.springframework.org/schema/ 
> beans">apache.org</value>
>         </saslRealms>
>
>         <!-- the collection of extended operation handlers to  
> install           -->
>         <extendedOperationHandlers>
>           <gracefulShutdownHandler/>
>           <launchDiagnosticUiHandler/>
>         </extendedOperationHandlers>
>       </ldapConfiguration>
>     </ldapConfiguration>
>
>     <ldapsConfiguration>
>       <ldapConfiguration id="ldapsConfiguration"
>                          enabled="false"
>                          ipPort="636"
>                          enableLdaps="true">
>       </ldapConfiguration>
>     </ldapsConfiguration>
>
>     <systemPartitionConfiguration>
>       <!-- use the following partitionConfiguration to override  
> defaults for  -->
>       <!-- the system  
> partition                                               -->
>       <mutableBTreePartitionConfiguration  
> id="systemPartitionConfiguration"
>         name="system"
>         cacheSize="100"
>         suffix="ou=system"
>         optimizerEnabled="true"
>         synchOnWrite="true">
>         <indexedAttributes>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
>               cacheSize="10"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>               cacheSize="10"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>               cacheSize="10"/>
>             <mutableIndexConfiguration
>               attributeId="ou"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="uid"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="objectClass"
>               cacheSize="100"/>
>         </indexedAttributes>
>         <contextEntry>
>           <value xmlns="http://www.springframework.org/schema/beans">
>             objectClass: top
>             objectClass: organizationalUnit
>             objectClass: extensibleObject
>             ou: system
>           </value>
>         </contextEntry>
>       </mutableBTreePartitionConfiguration>
>     </systemPartitionConfiguration>
>
>     <partitionConfigurations>
>       <mutableBTreePartitionConfiguration  
> id="examplePartitionConfiguration"
>         name="example"
>         cacheSize="100"
>         suffix="dc=example,dc=com"
>         optimizerEnabled="true"
>         synchOnWrite="true">
>         <indexedAttributes>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
>               cacheSize="10"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>               cacheSize="10"/>
>             <mutableIndexConfiguration
>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>               cacheSize="10"/>
>             <mutableIndexConfiguration
>               attributeId="dc"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="ou"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="krb5PrincipalName"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="uid"
>               cacheSize="100"/>
>             <mutableIndexConfiguration
>               attributeId="objectClass"
>               cacheSize="100"/>
>         </indexedAttributes>
>         <contextEntry>
>           <value xmlns="http://www.springframework.org/schema/beans">
>             objectClass: top
>             objectClass: domain
>             objectClass: extensibleObject
>             dc: example
>           </value>
>         </contextEntry>
>       </mutableBTreePartitionConfiguration>
>     </partitionConfigurations>
>
>     <interceptorConfigurations>
>       <mutableInterceptorConfiguration
>               name="normalizationService">
>         <interceptor>
>           <normalizationService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="authenticationService">
>         <interceptor>
>           <authenticationService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="referralService">
>         <interceptor>
>           <referralService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="authorizationService">
>         <interceptor>
>           <authorizationService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="defaultAuthorizationService">
>         <interceptor>
>           <defaultAuthorizationService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="exceptionService">
>         <interceptor>
>           <exceptionService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="operationalAttributeService">
>         <interceptor>
>           <operationalAttributeService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="schemaService">
>         <interceptor>
>           <schemaService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="subentryService">
>         <interceptor>
>           <subentryService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="collectiveAttributeService">
>         <interceptor>
>           <collectiveAttributeService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="eventService">
>         <interceptor>
>           <eventService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>       <mutableInterceptorConfiguration
>               name="triggerService">
>         <interceptor>
>           <triggerService/>
>         </interceptor>
>       </mutableInterceptorConfiguration>
>
>     </interceptorConfigurations>
>   </mutableServerStartupConfiguration>
>
>
> <!-- another bean I didn't convert -->
>   <bean  
> class="org.springframework.beans.factory.config.CustomEditorConfigurer 
> ">
>     <property name="customEditors">
>       <map>
>         <entry key="javax.naming.directory.Attributes">
>           <bean  
> class="org.apache.directory.server.core.configuration.AttributesProper 
> tyEditor"/>
>         </entry>
>       </map>
>     </property>
>   </bean>
> </beans>
>
>
> Comments?
>
> thanks
> david jencks
>
>


Re: Simplified server configuration with xbean-spring

Posted by Alex Karasulu <ak...@apache.org>.
Hi Dave,

I have not spent much on this thread so I may not be up to date however I
think I can answer
some of your questions below.

On 7/3/07, David Jencks <da...@yahoo.com> wrote:
>
>
> On Jul 2, 2007, at 11:55 PM, Emmanuel Lecharny wrote:
>
> > Hi guys,
> >
> > sorry for the "deafening silence" ... We were quite busy those last
> > days, up to a point we let this important mail dying silently ...
> >
> > ok, I agree with David that the current server.xml is, to say the
> > least, not very easy to handle, as it does not carry a lot of
> > semantic.
> >
> > Now, from our users perspective, we have two problems :
> > 1) current users don't manipulate a lot this file, as you don't fix
> > something which work, as soon as it's complicated to male it work
> > again, due to the complexity of the current configuration file ( kind
> > of circular situation ... )
> > 2) new users are simply afraid to touch this configuration file,
> > because it's too complex...
> >
> > We have two ideas to help solving those problems :
> > 1) Apache Directory Studio contains a GUI which helps to manupulate
> > this file. Not sure that users are aware of that ...
> > 2) we really want to move almost all of this configuration into the
> > DIT in the next few months, so that we will be able to avoid having
> > such a massive configuration file
> >
> > The second solution will obviously be coupled with a new version of
> > the first one.
> >
> > I would add that there is no good solution to such a problem. We went
> > from property file to spring configuration because the property file
> > was ugly and didn't carried enough semantic. Now it's the same problem
> > again. Pushing all the configuration into the DIT won't add extra
> > semantic... This is a dead end. Wat I would suggest in this case is
> > the least we change the configuration, the more likely users will get
> > used with it. And I pretty much favor a move to the DIT for the sake
> > of completeness : using LDAP to manage itself.
> >
> > Let's face the reality : whatever level of semantic you add to a
> > configuration file, you will _always_ need a good doco and nothing
> > will replace the RTFM credo...
>
> Having a grammar for the config helps a lot in my experience.  xml
> schema is the only grammar language I'm familiar with that is
> reasonably comprehensible and has a lot of easily available grammar-
> aware editors.  I think writing your own language and tools to edit
> it may not necessarily make a lot of friends.
>
>
> I don't understand a couple details of this plan...
>
> - Isn't there a bootstrap or chicken/egg problem with getting a
> server to the point of being able to read its own configuration?  Or
> is the plan to bootstrap a simple server with no external
> connectivity, use it to read the config and start the real server,
> and then throw it away?


Something like that. The thing is you don't start the entire server but just
start
up the system partition to look up the configuration.

- Does this mean that the spring xml files or xbean-spring xml file
> will be replace by a server.ldif file, in terms of being able to edit
> the configuration?  Or is the plan to force anyone who want to look
> at or modify the server config to fire up Apache Directory Studio?
> It's hard for me to see either of these as an advance over editing
> even the current server.xml files.  Being able to edit the server
> config in vi or emacs has its advantages.
>
> - Is the plan to completely ditch spring and write your own wiring
> framework?


I'd like to load the configuration out of the DIT and not bother with spring
at all.

Alex

Re: Simplified server configuration with xbean-spring

Posted by David Jencks <da...@yahoo.com>.
On Jul 2, 2007, at 11:55 PM, Emmanuel Lecharny wrote:

> Hi guys,
>
> sorry for the "deafening silence" ... We were quite busy those last
> days, up to a point we let this important mail dying silently ...
>
> ok, I agree with David that the current server.xml is, to say the
> least, not very easy to handle, as it does not carry a lot of
> semantic.
>
> Now, from our users perspective, we have two problems :
> 1) current users don't manipulate a lot this file, as you don't fix
> something which work, as soon as it's complicated to male it work
> again, due to the complexity of the current configuration file ( kind
> of circular situation ... )
> 2) new users are simply afraid to touch this configuration file,
> because it's too complex...
>
> We have two ideas to help solving those problems :
> 1) Apache Directory Studio contains a GUI which helps to manupulate
> this file. Not sure that users are aware of that ...
> 2) we really want to move almost all of this configuration into the
> DIT in the next few months, so that we will be able to avoid having
> such a massive configuration file
>
> The second solution will obviously be coupled with a new version of
> the first one.
>
> I would add that there is no good solution to such a problem. We went
> from property file to spring configuration because the property file
> was ugly and didn't carried enough semantic. Now it's the same problem
> again. Pushing all the configuration into the DIT won't add extra
> semantic... This is a dead end. Wat I would suggest in this case is
> the least we change the configuration, the more likely users will get
> used with it. And I pretty much favor a move to the DIT for the sake
> of completeness : using LDAP to manage itself.
>
> Let's face the reality : whatever level of semantic you add to a
> configuration file, you will _always_ need a good doco and nothing
> will replace the RTFM credo...

Having a grammar for the config helps a lot in my experience.  xml  
schema is the only grammar language I'm familiar with that is  
reasonably comprehensible and has a lot of easily available grammar- 
aware editors.  I think writing your own language and tools to edit  
it may not necessarily make a lot of friends.


I don't understand a couple details of this plan...

- Isn't there a bootstrap or chicken/egg problem with getting a  
server to the point of being able to read its own configuration?  Or  
is the plan to bootstrap a simple server with no external  
connectivity, use it to read the config and start the real server,  
and then throw it away?

- Does this mean that the spring xml files or xbean-spring xml file  
will be replace by a server.ldif file, in terms of being able to edit  
the configuration?  Or is the plan to force anyone who want to look  
at or modify the server config to fire up Apache Directory Studio?   
It's hard for me to see either of these as an advance over editing  
even the current server.xml files.  Being able to edit the server  
config in vi or emacs has its advantages.

- Is the plan to completely ditch spring and write your own wiring  
framework?

thanks
david jencks

Re: Simplified server configuration with xbean-spring

Posted by Martin Alderson <Ma...@salfordsoftware.co.uk>.
Hi All,

My personal experience with the current server.xml has been while producing my own distribution of ApacheDS with some of my own custom interceptors and partitions.  I found it very powerful and being able to play around with the low level structure of ApacheDS without making changes to the source was very useful.  For distribution however, I am making my own configuration file format which will only offer our users the ability to change basic options such as administrator password and listening port number.  The distribution is for a very specific purpose and the users should not be messing around with the internals.  The server.xml will still be there but it will be hidden away as just another data file rather than something the user is expected to edit.

I wonder if ApacheDS itself shouldn't be doing the same thing?  If a systems administrator just wants an LDAP server they shouldn't have to be editing a large XML file with lots of low-level implementation details such as the ordering of interceptors.  Perhaps we should have a simple configuration file for administrators that just want to get a server up and running, and a separate one for developers that gives the full power of the current server.xml.

To me the xbeans make the file a little easier to read but I think the biggest problem is the structure and sheer amount of configuration that we make available.

As for moving the configuration into the DIT - I think that would be great as it would instantly give several nice features: global configuration for all replicas, a way to manage the server remotely, and possibly "live" configuration (no restart required).  I do, however, agree with others that this would be losing the ability to hand edit if things go wrong and makes it a little harder to backup.

Perhaps we could have a configuration partition which reads from / writes to the XML configuration file(s)?  I think the XML configuration files could map almost directly into LDAP entries.  I think this would give us the best of both worlds.

Cheers,

Martin




Re: Simplified server configuration with xbean-spring

Posted by Norval Hope <nr...@gmail.com>.
I'm afraid as a user who has made considerable additions/customizations to
server.xml (due to custom additions to the classes created by Spring using
it) I'm very worried about having to port everything over to a
"stored-in-DIT" model at some point in the future. Would it be feasible to
maintain support for the old style config an parallel alternative ? Frankly
I think XML is a much richer medium to express complex configuration
settings as beans, then an LDAP schema which is better suited to modelling
much simpler abstractions.

Also I'm not sure my users would react very favourably to having the start
the server up (*especially* in a different mode) in order to make config
changes. Would they still need to restart the server again afterwards to
have the settings take effect? Aren't there concerns about rendering the
server unstartable after editing settings, and if so isn't a single back-up
file preferrable to have to back-up the entire system partition DIT?

My 2c

Re: Simplified server configuration with xbean-spring

Posted by Emmanuel Lecharny <el...@apache.org>.
David Jencks a écrit :

>
> On Jul 8, 2007, at 5:48 PM, Emmanuel Lecharny wrote:
>
>> Mark Swanson a écrit :
>>
>>> Emmanuel Lecharny wrote:
>>> <snip/>
>>> Still catching up -- working backwards... wrt the "problems"
>>>
>>> 1. I disagree that this file is complex. It's straightforward,  
>>> simple, and sensible. Perhaps more docs would make it easier for  
>>> folks but come on, this is light years ahead of other LDAP  configs. 
>>> This _small_ XML config file is a _single_ file. I like it.
>>>
>>> Create a simple howto with samples on how to configure it for the  
>>> most common use cases. Just enable folks to copy/paste the common  
>>> config options.
>>
>>
>>
>> Well, from your poit of view, as a experienced user, yes, the  
>> current server.xml is not too complex. But :
>> - for new commers, it's quite difficult to get in (and I must admit  
>> that Dave has a point ith XSchema)
>> - and the current configuration won't reflect the next level of  
>> configuration we will reach when all what we want to add into the  
>> server will be done.
>>
>>>
>>> 2. Please _PLEASE_ DO NOT put config info into ADS. Do NOT make me  
>>> use a GUI tool to configure ADS.  I can't always make an X  
>>> connection to an ADS machine and it would be a lot of trouble to  
>>> map and route specific ports in front of the virtual IP router to  
>>> manage specific ADS instances from port 389. I really like being  
>>> able to edit the XML file with a text editor.
>>
>>
>> We will put the config into ADS _and_ you won't have to use a GUI  to 
>> configure the server :). Open Ldap works exactly the wame way,  using 
>> LDIF fiels to modify the configuration. Obviously, this is  quite a 
>> good solution.
>
>
> Umm, really?  You'd prefer to deal with  ldif files for the server  
> config rather than the validatable-by-most-xml-editors xbean-spring  
> configuration files?  

I don't like to deal with configiration files at all. This is something 
I do reluctantly, when absolutly needed, and this is not quite often. 
It's like reading latin to me. Some people like latin... I don't. Having 
a latin grammar beside me don't help a lot  ;)

Ok, we do have a GUI to manipulate the server.xml file, and it will be 
able to manipulate LDIF too. This will be an offline editor, so for 
those who are afraid of having to oepn a X session : first edit the 
configuration file with the studio (auto-validations, combo-boxes with 
proposed vaues, etc : everything that XSchema don't offer natively :), 
second save the file, and push it to your distant server.


> So, whenever you edit something you get to  reload the ldif to find 
> out if you made a typo?  Are most ldap users  much more comfortable 
> with  ldif files than xml?

As I said, thanks to the GUI, obvious error won't be injected into the 
server. Of course, if you decide to set the cache to 10000000 instead of 
1000, then you are dead. Ldif and XML are meant to be read by parsers, 
not by human beings. (As far as I feel it, XSchema is one of the most 
atrocious example of overworked piece of XML... But may be it's just me ;)

>>
>> Anyway, we won't be able to please all the users ... But having the  
>> configuration into the server will help a lot when dealing with  
>> replicated servers (no need to login on N servers, we will have a  
>> way to 'replicate' the configuration)
>
>
> The replication seems like a plus for the store-in-ldap solution.  On  
> the other hand it could turn into a way to break all the servers at  
> once rather than only breaking one in case the edit didn't work :-)

Yeah : having only one server down when you can break the whole pile of 
servers is not really good : when it's broken, it should be seriously 
broken ;) Ok, you are right, my point is not very valid...

Thanks

Emmanuel

Re: Simplified server configuration with xbean-spring

Posted by David Jencks <da...@yahoo.com>.
On Jul 8, 2007, at 5:48 PM, Emmanuel Lecharny wrote:

> Mark Swanson a écrit :
>
>> Emmanuel Lecharny wrote:
>> <snip/>
>> Still catching up -- working backwards... wrt the "problems"
>>
>> 1. I disagree that this file is complex. It's straightforward,  
>> simple, and sensible. Perhaps more docs would make it easier for  
>> folks but come on, this is light years ahead of other LDAP  
>> configs. This _small_ XML config file is a _single_ file. I like it.
>>
>> Create a simple howto with samples on how to configure it for the  
>> most common use cases. Just enable folks to copy/paste the common  
>> config options.
>
>
> Well, from your poit of view, as a experienced user, yes, the  
> current server.xml is not too complex. But :
> - for new commers, it's quite difficult to get in (and I must admit  
> that Dave has a point ith XSchema)
> - and the current configuration won't reflect the next level of  
> configuration we will reach when all what we want to add into the  
> server will be done.
>
>>
>> 2. Please _PLEASE_ DO NOT put config info into ADS. Do NOT make me  
>> use a GUI tool to configure ADS.  I can't always make an X  
>> connection to an ADS machine and it would be a lot of trouble to  
>> map and route specific ports in front of the virtual IP router to  
>> manage specific ADS instances from port 389. I really like being  
>> able to edit the XML file with a text editor.
>
> We will put the config into ADS _and_ you won't have to use a GUI  
> to configure the server :). Open Ldap works exactly the wame way,  
> using LDIF fiels to modify the configuration. Obviously, this is  
> quite a good solution.

Umm, really?  You'd prefer to deal with  ldif files for the server  
config rather than the validatable-by-most-xml-editors xbean-spring  
configuration files?  So, whenever you edit something you get to  
reload the ldif to find out if you made a typo?  Are most ldap users  
much more comfortable with  ldif files than xml?
>
> Anyway, we won't be able to please all the users ... But having the  
> configuration into the server will help a lot when dealing with  
> replicated servers (no need to login on N servers, we will have a  
> way to 'replicate' the configuration)

The replication seems like a plus for the store-in-ldap solution.  On  
the other hand it could turn into a way to break all the servers at  
once rather than only breaking one in case the edit didn't work :-)

thanks
david jencks

>
> Emmanuel
>


Re: Simplified server configuration with xbean-spring

Posted by Emmanuel Lecharny <el...@apache.org>.
Mark Swanson a écrit :

> Emmanuel Lecharny wrote:
> <snip/>
> Still catching up -- working backwards... wrt the "problems"
>
> 1. I disagree that this file is complex. It's straightforward, simple, 
> and sensible. Perhaps more docs would make it easier for folks but 
> come on, this is light years ahead of other LDAP configs. This _small_ 
> XML config file is a _single_ file. I like it.
>
> Create a simple howto with samples on how to configure it for the most 
> common use cases. Just enable folks to copy/paste the common config 
> options.


Well, from your poit of view, as a experienced user, yes, the current 
server.xml is not too complex. But :
- for new commers, it's quite difficult to get in (and I must admit that 
Dave has a point ith XSchema)
- and the current configuration won't reflect the next level of 
configuration we will reach when all what we want to add into the server 
will be done.

>
> 2. Please _PLEASE_ DO NOT put config info into ADS. Do NOT make me use 
> a GUI tool to configure ADS.  I can't always make an X connection to 
> an ADS machine and it would be a lot of trouble to map and route 
> specific ports in front of the virtual IP router to manage specific 
> ADS instances from port 389. I really like being able to edit the XML 
> file with a text editor.

We will put the config into ADS _and_ you won't have to use a GUI to 
configure the server :). Open Ldap works exactly the wame way, using 
LDIF fiels to modify the configuration. Obviously, this is quite a good 
solution.

Anyway, we won't be able to please all the users ... But having the 
configuration into the server will help a lot when dealing with 
replicated servers (no need to login on N servers, we will have a way to 
'replicate' the configuration)

Emmanuel


Re: Simplified server configuration with xbean-spring

Posted by Alex Karasulu <ak...@apache.org>.
Fair enough.  We can still allow for XML based configuration files in
addition
to alternative methods.  Perhaps we can push the use of such a mechanism
to be based on an optional system parameter.

Alex

On 7/9/07, Mark Swanson <ma...@scheduleworld.com> wrote:
>
> Alex Karasulu wrote:
> > Mark keep in mind that you can use command line tools instead of a GUI
> > to set the configuration of the server when the configuration is in the
> DIT.
> >
> > Furthermore you can just load an LDIF instead of using a server.xml to
> > setup the initial configuration of the server.  So you get the best of
> both
> > worlds: a flat configuration file and remote configuration capabilities.
> >
> > However we want to make sure we make the configuration interfaces as
> > easy to use as they were with the server.xml but behind the scenes
> > different mechanisms will be utilized.  All in all it should be much
> more
> > plyable.
>
> Ok. One more email from me and I will stop being a stick in the mud :-)
>
> From what I understand of the command line tools, I assume you are
> speaking of 'load LDIF into server'?
>
> Wrt LDIF - I am sure that the sample ldif file with embedded examples
> would be more confusing to me, and a GUI/LDAP editor is not going to
> make this any better. I agree with Norval:
>
> <quote>
> Frankly I think XML is a much richer medium to express complex
> configuration settings as beans, then an LDAP schema which is better
> suited to modelling much simpler abstractions.
> </quote>
>
> <b> +1 </b>
>
> The existing configuration process works. Let's leave it at that and if
> folks want to take the time to build a GUI/alternate config format then
> please consider creating it as an alternate config/maintenance option.
> (Even if it was the primary/default option).
>
> Cheers.
>
> --
> http://www.ScheduleWorld.com/
> Free Google Calendar synchronization with Outlook, Evolution,
> cell phones, BlackBerry, PalmOS, Exchange, Mozilla, Thunderbird,
> Pocket PC/Windows Mobile. Also sync tasks, notes and contacts!
> WebDAV, vfreebusy, RSS, LDAP, iCalendar, iTIP, iMIP support.
>

Re: Simplified server configuration with xbean-spring

Posted by Mark Swanson <ma...@ScheduleWorld.com>.
Alex Karasulu wrote:
> Mark keep in mind that you can use command line tools instead of a GUI
> to set the configuration of the server when the configuration is in the DIT.
> 
> Furthermore you can just load an LDIF instead of using a server.xml to
> setup the initial configuration of the server.  So you get the best of both
> worlds: a flat configuration file and remote configuration capabilities.
> 
> However we want to make sure we make the configuration interfaces as
> easy to use as they were with the server.xml but behind the scenes
> different mechanisms will be utilized.  All in all it should be much more
> plyable.

Ok. One more email from me and I will stop being a stick in the mud :-)

 From what I understand of the command line tools, I assume you are 
speaking of 'load LDIF into server'?

Wrt LDIF - I am sure that the sample ldif file with embedded examples 
would be more confusing to me, and a GUI/LDAP editor is not going to 
make this any better. I agree with Norval:

<quote>
Frankly I think XML is a much richer medium to express complex 
configuration settings as beans, then an LDAP schema which is better 
suited to modelling much simpler abstractions.
</quote>

<b> +1 </b>

The existing configuration process works. Let's leave it at that and if 
folks want to take the time to build a GUI/alternate config format then 
please consider creating it as an alternate config/maintenance option. 
(Even if it was the primary/default option).

Cheers.

-- 
http://www.ScheduleWorld.com/
Free Google Calendar synchronization with Outlook, Evolution,
cell phones, BlackBerry, PalmOS, Exchange, Mozilla, Thunderbird,
Pocket PC/Windows Mobile. Also sync tasks, notes and contacts!
WebDAV, vfreebusy, RSS, LDAP, iCalendar, iTIP, iMIP support.

Re: Simplified server configuration with xbean-spring

Posted by Alex Karasulu <ak...@apache.org>.
Mark keep in mind that you can use command line tools instead of a GUI
to set the configuration of the server when the configuration is in the DIT.

Furthermore you can just load an LDIF instead of using a server.xml to
setup the initial configuration of the server.  So you get the best of both
worlds: a flat configuration file and remote configuration capabilities.

However we want to make sure we make the configuration interfaces as
easy to use as they were with the server.xml but behind the scenes
different mechanisms will be utilized.  All in all it should be much more
plyable.

Alex

On 7/6/07, Mark Swanson <ma...@scheduleworld.com> wrote:
>
> Emmanuel Lecharny wrote:
> > Hi guys,
> >
> > sorry for the "deafening silence" ... We were quite busy those last
> > days, up to a point we let this important mail dying silently ...
> >
> > ok, I agree with David that the current server.xml is, to say the
> > least, not very easy to handle, as it does not carry a lot of
> > semantic.
> >
> > Now, from our users perspective, we have two problems :
> > 1) current users don't manipulate a lot this file, as you don't fix
> > something which work, as soon as it's complicated to male it work
> > again, due to the complexity of the current configuration file ( kind
> > of circular situation ... )
> > 2) new users are simply afraid to touch this configuration file,
> > because it's too complex...
> >
> > We have two ideas to help solving those problems :
> > 1) Apache Directory Studio contains a GUI which helps to manupulate
> > this file. Not sure that users are aware of that ...
> > 2) we really want to move almost all of this configuration into the
> > DIT in the next few months, so that we will be able to avoid having
> > such a massive configuration file
> >
> > The second solution will obviously be coupled with a new version of
> > the first one.
> >
>
> Still catching up -- working backwards... wrt the "problems"
>
> 1. I disagree that this file is complex. It's straightforward, simple,
> and sensible. Perhaps more docs would make it easier for folks but come
> on, this is light years ahead of other LDAP configs. This _small_ XML
> config file is a _single_ file. I like it.
>
> Create a simple howto with samples on how to configure it for the most
> common use cases. Just enable folks to copy/paste the common config
> options.
>
> 2. Please _PLEASE_ DO NOT put config info into ADS. Do NOT make me use a
> GUI tool to configure ADS.  I can't always make an X connection to an
> ADS machine and it would be a lot of trouble to map and route specific
> ports in front of the virtual IP router to manage specific ADS instances
> from port 389. I really like being able to edit the XML file with a text
> editor.
>
> The xbean-spring stuff is fine too, btw.
>
> Cheers.
>
>
>
>
> --
> http://www.ScheduleWorld.com/
> Free Google Calendar synchronization with Outlook, Evolution,
> cell phones, BlackBerry, PalmOS, Exchange, Mozilla, Thunderbird,
> Pocket PC/Windows Mobile. Also sync tasks, notes and contacts!
> WebDAV, vfreebusy, RSS, LDAP, iCalendar, iTIP, iMIP support.
>

Re: Simplified server configuration with xbean-spring

Posted by Mark Swanson <ma...@ScheduleWorld.com>.
Emmanuel Lecharny wrote:
> Hi guys,
> 
> sorry for the "deafening silence" ... We were quite busy those last
> days, up to a point we let this important mail dying silently ...
> 
> ok, I agree with David that the current server.xml is, to say the
> least, not very easy to handle, as it does not carry a lot of
> semantic.
> 
> Now, from our users perspective, we have two problems :
> 1) current users don't manipulate a lot this file, as you don't fix
> something which work, as soon as it's complicated to male it work
> again, due to the complexity of the current configuration file ( kind
> of circular situation ... )
> 2) new users are simply afraid to touch this configuration file,
> because it's too complex...
> 
> We have two ideas to help solving those problems :
> 1) Apache Directory Studio contains a GUI which helps to manupulate
> this file. Not sure that users are aware of that ...
> 2) we really want to move almost all of this configuration into the
> DIT in the next few months, so that we will be able to avoid having
> such a massive configuration file
> 
> The second solution will obviously be coupled with a new version of
> the first one.
> 

Still catching up -- working backwards... wrt the "problems"

1. I disagree that this file is complex. It's straightforward, simple, 
and sensible. Perhaps more docs would make it easier for folks but come 
on, this is light years ahead of other LDAP configs. This _small_ XML 
config file is a _single_ file. I like it.

Create a simple howto with samples on how to configure it for the most 
common use cases. Just enable folks to copy/paste the common config options.

2. Please _PLEASE_ DO NOT put config info into ADS. Do NOT make me use a 
GUI tool to configure ADS.  I can't always make an X connection to an 
ADS machine and it would be a lot of trouble to map and route specific 
ports in front of the virtual IP router to manage specific ADS instances 
from port 389. I really like being able to edit the XML file with a text 
editor.

The xbean-spring stuff is fine too, btw.

Cheers.




-- 
http://www.ScheduleWorld.com/
Free Google Calendar synchronization with Outlook, Evolution,
cell phones, BlackBerry, PalmOS, Exchange, Mozilla, Thunderbird,
Pocket PC/Windows Mobile. Also sync tasks, notes and contacts!
WebDAV, vfreebusy, RSS, LDAP, iCalendar, iTIP, iMIP support.

Re: Simplified server configuration with xbean-spring

Posted by Emmanuel Lecharny <el...@gmail.com>.
Ole,

your proposal is not insane, but I'm afraid it won't solve the problem
we have...

We need to add some semantic to the configuration, and all the
EMF/XSchema/DAS layers won't help, IMHO.

KISS should be the way to go, I think.

On 7/3/07, Ole Ersoy <ol...@gmail.com> wrote:
> Cocktail.  I'll even throw in an Olive :-)  Maybe it should simplify a little more though.  We already have spring beans (Pojos).  The code generated from the EMF model is the same thing.  So think of the EMF model as the spring POJOs, with the additional xml semantics that Xbean brings.  Now we also want to store this model in ADS, and the DAS is an elegant way of doing this, as well as performing CRUD operations on server configuration entries.  Make more sense?
>
> Cheers,
> - Ole
>
>
>
> Ersin Er wrote:
> > On 7/3/07, Ole Ersoy <ol...@gmail.com> wrote:
> >> OK - I'll just throw one more idea into the mix.
> >>
> >> Model the configuration file using xml schema.  Generate an EMF Model
> >> for it (This way serialized model instances conform to the schema
> >> keeping the semantic meaning intact).  Set the configuration defaults
> >> on the EMF Model.  Use the LDAP DAS to store the default entries in
> >> ApacheDS.  Now when ADS starts, it reads the configuration entries via
> >> the LDAP DAS and loads the corresponding EMF Model.  LS would also
> >> read the configuration file via the LDAP DAS and display it to the
> >> user for updates.  Then LS can save it to it's xml representation,
> >> reload it (Later if needed), and be the client for handling server
> >> updates.  Thoughts?
> >
> > So this is for simplifying things or making a technology cocktail ?
> >
> >> Cheers,
> >> - Ole
> >>
> >>
> >> Emmanuel Lecharny wrote:
> >> > Hi guys,
> >> >
> >> > sorry for the "deafening silence" ... We were quite busy those last
> >> > days, up to a point we let this important mail dying silently ...
> >> >
> >> > ok, I agree with David that the current server.xml is, to say the
> >> > least, not very easy to handle, as it does not carry a lot of
> >> > semantic.
> >> >
> >> > Now, from our users perspective, we have two problems :
> >> > 1) current users don't manipulate a lot this file, as you don't fix
> >> > something which work, as soon as it's complicated to male it work
> >> > again, due to the complexity of the current configuration file ( kind
> >> > of circular situation ... )
> >> > 2) new users are simply afraid to touch this configuration file,
> >> > because it's too complex...
> >> >
> >> > We have two ideas to help solving those problems :
> >> > 1) Apache Directory Studio contains a GUI which helps to manupulate
> >> > this file. Not sure that users are aware of that ...
> >> > 2) we really want to move almost all of this configuration into the
> >> > DIT in the next few months, so that we will be able to avoid having
> >> > such a massive configuration file
> >> >
> >> > The second solution will obviously be coupled with a new version of
> >> > the first one.
> >> >
> >> > I would add that there is no good solution to such a problem. We went
> >> > from property file to spring configuration because the property file
> >> > was ugly and didn't carried enough semantic. Now it's the same problem
> >> > again. Pushing all the configuration into the DIT won't add extra
> >> > semantic... This is a dead end. Wat I would suggest in this case is
> >> > the least we change the configuration, the more likely users will get
> >> > used with it. And I pretty much favor a move to the DIT for the sake
> >> > of completeness : using LDAP to manage itself.
> >> >
> >> > Let's face the reality : whatever level of semantic you add to a
> >> > configuration file, you will _always_ need a good doco and nothing
> >> > will replace the RTFM credo...
> >> >
> >> > My 2cts...
> >> >
> >> > On 7/3/07, Chris Custine <cc...@apache.org> wrote:
> >> >> I could swear I replied to this the night you sent it but obviously I
> >> >> didn't
> >> >>  :-)
> >> >>
> >> >> +1 (caveat below)
> >> >>
> >> >> I love xbean spring config files because I use ActiveMQ and ServiceMix
> >> >> quite
> >> >> a bit and it really does help with some of the verbosity of the spring
> >> >> files.  I think the lack of replies was because we have had several
> >> >> discussions about removing the Spring config file and storing the
> >> >> config in
> >> >> the DIT which would render this discussion irrelevant.
> >> >>
> >> >> While we were in Amsterdam I played with the idea of a LDAP Spring
> >> >> context
> >> >> schema that loaded from LDAP and I have also seen some people refer to
> >> >> loading the context as an xml string from a single LDAP entry.
> >> These are
> >> >> all viable options as well.
> >> >>
> >> >> In the mean time, I am all for using xbean to get some more mileage
> >> >> out of
> >> >> the current state of things and maybe this will actually alleviate
> >> >> some of
> >> >> the complaints about server.xml and I think we should do it sooner
> >> rather
> >> >> than later.
> >> >>
> >> >> Chris
> >> >>
> >> >>
> >> >> On 7/2/07, David Jencks <da...@yahoo.com> wrote:
> >> >> >
> >> >> > On Jul 2, 2007, at 8:32 PM, Aron Sogor wrote:
> >> >> >
> >> >> > > I am no Spring expert but how would it work for 3rd party
> >> >> integration.
> >> >> > > When I want to insert my own "private" Mutable****Configuration?
> >> >> > > How would I register those classes...
> >> >> > > It would seem to make more difficult.
> >> >> >
> >> >> > With xbean-spring you can still use standard spring configuration: I
> >> >> > left 2 beans unconverted in the server.xml below to show this. In
> >> >> > fact the original server.xml still works as well, I converted it a
> >> >> > bean at a time and ran everything I could figure out to make sure it
> >> >> > stayed working.  You can also "annotate" your source code and run
> >> the
> >> >> > maven plugin on them to generate a schema (in a different namespace)
> >> >> > and use that to configure your bean with xbean-spring.  I don't this
> >> >> > as being more difficult, but as supplying more options.
> >> >> >
> >> >> > thanks
> >> >> > david jencks
> >> >> >
> >> >> > >
> >> >> > > Aron
> >> >> > > David Jencks wrote:
> >> >> > >> So does the deafening silence that greeted this mean everyone is
> >> >> > >> so awed by this that they are left speechless? :-)
> >> >> > >>
> >> >> > >> Seriously, does anyone have any comments on this?  Does everyone
> >> >> > >> prefer the untyped spring style?
> >> >> > >>
> >> >> > >> On a related note, I've seen a lot of Mutable****Configuration
> >> >> > >> classes in various spots and AFAICT their only purpose is to
> >> >> > >> support springs troubles with constructor dependency
> >> injection.  I
> >> >> > >> think there's a way to use xbean-spring to make the xml style as
> >> >> > >> below fit into constructor dependency injection.  Any interest in
> >> >> > >> this, or does everyone prefer what's happening now?
> >> >> > >>
> >> >> > >> thanks
> >> >> > >> david jencks
> >> >> > >>
> >> >> > >>
> >> >> > >> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
> >> >> > >>
> >> >> > >>> A while back there was some discussion of whether server.xml
> >> >> > >>> could be made to be more semantically meaningful with less
> >> >> > >>> generic cruft, and I suggested looking into xbean-spring.  So, I
> >> >> > >>> spent a bit of time on it and implemented this.  See https://
> >> >> > >>> issues.apache.org/jira/browse/DIRSERVER-984
> >> >> > >>>
> >> >> > >>> This was pretty easy to do, after fixing some problems in xbean.
> >> >> > >>> Basically all I did was add some javadoc "annotations" to tell
> >> >> > >>> xbean which classes to look at and what type collections
> >> contain,
> >> >> > >>> and change to the xbean application context from the plain
> >> spring
> >> >> > >>> one.
> >> >> > >>>
> >> >> > >>> xbean generates a schema for the configurable objects so you can
> >> >> > >>> consult the schema to see what can be configured.  As you can
> >> >> > >>> see, you can mix regular spring configuration and the xbean
> >> style
> >> >> > >>> in the same server.xml.
> >> >> > >>>
> >> >> > >>> There's a lot more customization possible, I basically did the
> >> >> > >>> minimum possible to get  it to work.  Pretty much anything can
> >> >> > >>> have a different name.  The main ugliness I see is the handling
> >> >> > >>> of properties that are lists (or sets) of strings.
> >> >> > >>>
> >> >> > >>> So, at the risk of posting too large a message,  here's the
> >> shiny
> >> >> > >>> new server.xml (I removed some commented out bits) :
> >> >> > >>>
> >> >> > >>> <?xml version="1.0" encoding="UTF-8"?>
> >> >> > >>>
> >> >> > >>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> >> >> > >>>
> >> >> "http://www.springframework.org/dtd/spring-beans.dtd">
> >> >> > >>>
> >> >> > >>> <beans>
> >> >> > >>> <!-- bean I didn't convert -->
> >> >> > >>>   <bean id="environment"
> >> >> > >>>
> >> >> class="org.springframework.beans.factory.config.PropertiesFactoryBea
> >> >> > >>> n">
> >> >> > >>>     <property name="properties">
> >> >> > >>>       <props>
> >> >> > >>>         <!-- JNDI security properties used to get initial
> >> >> > >>> contexts.         -->
> >> >> > >>>         <prop
> >> >> key="java.naming.security.authentication ">simple</
> >> >> > >>> prop>
> >> >> > >>>         <prop
> >> >> > >>> key="java.naming.security.principal">uid=admin,ou=system</prop>
> >> >> > >>>         <prop key="
> >> >> java.naming.security.credentials">secret</prop>
> >> >> > >>>       </props>
> >> >> > >>>     </property>
> >> >> > >>>   </bean>
> >> >> > >>>
> >> >> > >>>
> >> >> > >>>   <mutableServerStartupConfiguration
> >> >> id="configuration"
> >> >> > >>> xmlns="http://apacheds.org/config/1.0"
> >> >> > >>>
> >> >> workingDirectory="example.com "
> >> >> > >>>
> >> >> synchPeriodMillis="5000"
> >> >> > >>>                                      maxThreads="8"
> >> >> > >>>
> >> >> allowAnonymousAccess="false"
> >> >> > >>>
> >> >> accessControlEnabled="false"
> >> >> > >>>
> >> >> > >>> denormalizeOpAttrsEnabled="false"
> >> >> > >>>           >
> >> >> > >>>     <ntpConfiguration>
> >> >> > >>>       <ntpConfiguration
> >> >> > >>>               enabled="false"
> >> >> > >>>               ipPort="123">
> >> >> > >>>       </ntpConfiguration>
> >> >> > >>>     </ntpConfiguration>
> >> >> > >>>
> >> >> > >>>     <dnsConfiguration>
> >> >> > >>>       <dnsConfiguration
> >> >> > >>>               enabled="false"
> >> >> > >>>               ipPort="53">
> >> >> > >>>       </dnsConfiguration>
> >> >> > >>>     </dnsConfiguration>
> >> >> > >>>
> >> >> > >>>     <changePasswordConfiguration>
> >> >> > >>>       <changePasswordConfiguration
> >> >> > >>>               enabled="false"
> >> >> > >>>               ipPort="464">
> >> >> > >>>       </changePasswordConfiguration>
> >> >> > >>>     </changePasswordConfiguration>
> >> >> > >>>
> >> >> > >>>     <kdcConfiguration>
> >> >> > >>>       <kdcConfiguration
> >> >> > >>>               enabled="false"
> >> >> > >>>               ipPort="88">
> >> >> > >>>       </kdcConfiguration>
> >> >> > >>>     </kdcConfiguration>
> >> >> > >>>
> >> >> > >>>     <ldapConfiguration>
> >> >> > >>>       <ldapConfiguration id="ldapConfiguration"
> >> >> > >>>               ipPort="10389"
> >> >> > >>>               allowAnonymousAccess="false"
> >> >> > >>>               saslHost="ldap.example.com"
> >> >> > >>>
> >> >> saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM "
> >> >> > >>>               searchBaseDn="ou=users,ou=system"
> >> >> > >>>               maxTimeLimit="15000"
> >> >> > >>>               maxSizeLimit="1000">
> >> >> > >>>
> >> >> > >>>         <!-- The list of supported authentication
> >> >> > >>> mechanisms.                   -->
> >> >> > >>>         <supportedMechanisms>
> >> >> > >>>           <value xmlns="
> >> >> http://www.springframework.org/schema/
> >> >> > >>> beans">SIMPLE</value>
> >> >> > >>>           <value xmlns="
> >> >> http://www.springframework.org/schema/
> >> >> > >>> beans">CRAM-MD5</value>
> >> >> > >>>           <value
> >> >> xmlns="http://www.springframework.org/schema/
> >> >> > >>> beans">DIGEST-MD5</value>
> >> >> > >>>           <!--<value
> >> >> xmlns="http://www.springframework.org/schema/
> >> >> > >>> beans">GSSAPI</value>-->
> >> >> > >>>         </supportedMechanisms>
> >> >> > >>>
> >> >> > >>>         <!-- The desired quality-of-protection, used by DIGEST-
> >> >> > >>> MD5 and GSSAPI.  -->
> >> >> > >>>         <saslQop>
> >> >> > >>>           <value
> >> >> xmlns="http://www.springframework.org/schema/
> >> >> > >>> beans">auth</value>
> >> >> > >>>           <value xmlns="
> >> >> http://www.springframework.org/schema/
> >> >> > >>> beans">auth-int</value>
> >> >> > >>>           <value xmlns="
> >> >> http://www.springframework.org/schema/
> >> >> > >>> beans">auth-conf</value>
> >> >> > >>>         </saslQop>
> >> >> > >>>
> >> >> > >>>         <!-- The realms serviced by this SASL host, used by
> >> >> > >>> DIGEST-MD5 and GSSAPI. -->
> >> >> > >>>         <saslRealms>
> >> >> > >>>           <value
> >> >> xmlns="http://www.springframework.org/schema/
> >> >> > >>> beans">example.com</value>
> >> >> > >>>           <value
> >> >> xmlns="http://www.springframework.org/schema/
> >> >> > >>> beans">apache.org</value>
> >> >> > >>>         </saslRealms>
> >> >> > >>>
> >> >> > >>>         <!-- the collection of extended operation handlers to
> >> >> > >>> install           -->
> >> >> > >>>         <extendedOperationHandlers>
> >> >> > >>>           <gracefulShutdownHandler/>
> >> >> > >>>           <launchDiagnosticUiHandler/>
> >> >> > >>>         </extendedOperationHandlers>
> >> >> > >>>       </ldapConfiguration>
> >> >> > >>>     </ldapConfiguration>
> >> >> > >>>
> >> >> > >>>     <ldapsConfiguration>
> >> >> > >>>       <ldapConfiguration id="ldapsConfiguration"
> >> >> > >>>                          enabled="false"
> >> >> > >>>                          ipPort="636"
> >> >> > >>>                          enableLdaps="true">
> >> >> > >>>       </ldapConfiguration>
> >> >> > >>>     </ldapsConfiguration>
> >> >> > >>>
> >> >> > >>>     <systemPartitionConfiguration>
> >> >> > >>>       <!-- use the following partitionConfiguration to override
> >> >> > >>> defaults for  -->
> >> >> > >>>       <!-- the system
> >> >> > >>> partition
> >> >>   -->
> >> >> > >>>       <mutableBTreePartitionConfiguration
> >> >> > >>> id="systemPartitionConfiguration"
> >> >> > >>>         name="system"
> >> >> > >>>         cacheSize="100"
> >> >> > >>>         suffix="ou=system"
> >> >> > >>>         optimizerEnabled="true"
> >> >> > >>>         synchOnWrite="true">
> >> >> > >>>         <indexedAttributes>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
> >> >> > >>>               cacheSize="10"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
> >> >> > >>>               cacheSize="10"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
> >> >> > >>>               cacheSize="10"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="ou"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="uid"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="objectClass"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>         </indexedAttributes>
> >> >> > >>>         <contextEntry>
> >> >> > >>>           <value
> >> >> xmlns="http://www.springframework.org/schema/
> >> >> > >>> beans">
> >> >> > >>>             objectClass: top
> >> >> > >>>             objectClass: organizationalUnit
> >> >> > >>>             objectClass: extensibleObject
> >> >> > >>>             ou: system
> >> >> > >>>           </value>
> >> >> > >>>         </contextEntry>
> >> >> > >>>       </mutableBTreePartitionConfiguration>
> >> >> > >>>     </systemPartitionConfiguration>
> >> >> > >>>
> >> >> > >>>     <partitionConfigurations>
> >> >> > >>>       <mutableBTreePartitionConfiguration
> >> >> > >>> id="examplePartitionConfiguration"
> >> >> > >>>         name="example"
> >> >> > >>>         cacheSize="100"
> >> >> > >>>         suffix="dc=example,dc=com"
> >> >> > >>>         optimizerEnabled="true"
> >> >> > >>>         synchOnWrite="true">
> >> >> > >>>         <indexedAttributes>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
> >> >> > >>>               cacheSize="10"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
> >> >> > >>>               cacheSize="10"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
> >> >> > >>>               cacheSize="10"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="dc"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="ou"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="krb5PrincipalName"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="uid"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>             <mutableIndexConfiguration
> >> >> > >>>               attributeId="objectClass"
> >> >> > >>>               cacheSize="100"/>
> >> >> > >>>         </indexedAttributes>
> >> >> > >>>         <contextEntry>
> >> >> > >>>           <value
> >> >> xmlns="http://www.springframework.org/schema/
> >> >> > >>> beans">
> >> >> > >>>             objectClass: top
> >> >> > >>>             objectClass: domain
> >> >> > >>>             objectClass: extensibleObject
> >> >> > >>>             dc: example
> >> >> > >>>           </value>
> >> >> > >>>         </contextEntry>
> >> >> > >>>       </mutableBTreePartitionConfiguration>
> >> >> > >>>     </partitionConfigurations>
> >> >> > >>>
> >> >> > >>>     <interceptorConfigurations>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="normalizationService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <normalizationService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="authenticationService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <authenticationService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="referralService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <referralService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="authorizationService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <authorizationService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="defaultAuthorizationService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <defaultAuthorizationService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="exceptionService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <exceptionService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="operationalAttributeService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <operationalAttributeService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="schemaService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <schemaService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="subentryService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <subentryService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="collectiveAttributeService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <collectiveAttributeService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="eventService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <eventService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>       <mutableInterceptorConfiguration
> >> >> > >>>               name="triggerService">
> >> >> > >>>         <interceptor>
> >> >> > >>>           <triggerService/>
> >> >> > >>>         </interceptor>
> >> >> > >>>       </mutableInterceptorConfiguration>
> >> >> > >>>
> >> >> > >>>     </interceptorConfigurations>
> >> >> > >>>   </mutableServerStartupConfiguration>
> >> >> > >>>
> >> >> > >>>
> >> >> > >>> <!-- another bean I didn't convert -->
> >> >> > >>>   <bean
> >> >> > >>>
> >> >> class="org.springframework.beans.factory.config.CustomEditorConfigur
> >> >> > >>> er">
> >> >> > >>>     <property name="customEditors">
> >> >> > >>>       <map>
> >> >> > >>>         <entry
> >> >> key="javax.naming.directory.Attributes">
> >> >> > >>>           <bean
> >> >> > >>>
> >> >> class="org.apache.directory.server.core.configuration.AttributesProp
> >> >> > >>> ertyEditor"/>
> >> >> > >>>         </entry>
> >> >> > >>>       </map>
> >> >> > >>>     </property>
> >> >> > >>>   </bean>
> >> >> > >>> </beans>
> >> >> > >>>
> >> >> > >>>
> >> >> > >>> Comments?
> >> >> > >>>
> >> >> > >>> thanks
> >> >> > >>> david jencks
> >> >> > >>>
> >> >> > >>>
> >> >> > >>
> >> >> > >>
> >> >> > >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >
> >
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: Simplified server configuration with xbean-spring

Posted by Emmanuel Lecharny <el...@apache.org>.
Gunter, Tony a écrit :

>Please remove me from your Jira instance and your mailing list.
>  
>
Hi Gunter, to unsubscribe from the mailing list, just follow the 
instructions here :

http://directory.apache.org/community%26resources/mailing-lists-and-irc.html

We will look at JIRA, I don't know how to do it right now.

Thanks for your interest !

Emmanuel



RE: Simplified server configuration with xbean-spring

Posted by "Gunter, Tony" <to...@bearingpoint.com>.
Please remove me from your Jira instance and your mailing list.

-----Original Message-----
From: Ole Ersoy [mailto:ole.ersoy@gmail.com] 
Sent: Monday, July 02, 2007 11:54 PM
To: Apache Directory Developers List
Subject: Re: Simplified server configuration with xbean-spring

Cocktail.  I'll even throw in an Olive :-)  Maybe it should simplify a
little more though.  We already have spring beans (Pojos).  The code
generated from the EMF model is the same thing.  So think of the EMF
model as the spring POJOs, with the additional xml semantics that Xbean
brings.  Now we also want to store this model in ADS, and the DAS is an
elegant way of doing this, as well as performing CRUD operations on
server configuration entries.  Make more sense?

Cheers,
- Ole



Ersin Er wrote:
> On 7/3/07, Ole Ersoy <ol...@gmail.com> wrote:
>> OK - I'll just throw one more idea into the mix.
>>
>> Model the configuration file using xml schema.  Generate an EMF Model

>> for it (This way serialized model instances conform to the schema 
>> keeping the semantic meaning intact).  Set the configuration defaults

>> on the EMF Model.  Use the LDAP DAS to store the default entries in 
>> ApacheDS.  Now when ADS starts, it reads the configuration entries
via 
>> the LDAP DAS and loads the corresponding EMF Model.  LS would also 
>> read the configuration file via the LDAP DAS and display it to the 
>> user for updates.  Then LS can save it to it's xml representation, 
>> reload it (Later if needed), and be the client for handling server 
>> updates.  Thoughts?
> 
> So this is for simplifying things or making a technology cocktail ?
> 
>> Cheers,
>> - Ole
>>
>>
>> Emmanuel Lecharny wrote:
>> > Hi guys,
>> >
>> > sorry for the "deafening silence" ... We were quite busy those last
>> > days, up to a point we let this important mail dying silently ...
>> >
>> > ok, I agree with David that the current server.xml is, to say the
>> > least, not very easy to handle, as it does not carry a lot of
>> > semantic.
>> >
>> > Now, from our users perspective, we have two problems :
>> > 1) current users don't manipulate a lot this file, as you don't fix
>> > something which work, as soon as it's complicated to male it work
>> > again, due to the complexity of the current configuration file (
kind
>> > of circular situation ... )
>> > 2) new users are simply afraid to touch this configuration file,
>> > because it's too complex...
>> >
>> > We have two ideas to help solving those problems :
>> > 1) Apache Directory Studio contains a GUI which helps to manupulate
>> > this file. Not sure that users are aware of that ...
>> > 2) we really want to move almost all of this configuration into the
>> > DIT in the next few months, so that we will be able to avoid having
>> > such a massive configuration file
>> >
>> > The second solution will obviously be coupled with a new version of
>> > the first one.
>> >
>> > I would add that there is no good solution to such a problem. We
went
>> > from property file to spring configuration because the property
file
>> > was ugly and didn't carried enough semantic. Now it's the same
problem
>> > again. Pushing all the configuration into the DIT won't add extra
>> > semantic... This is a dead end. Wat I would suggest in this case is
>> > the least we change the configuration, the more likely users will
get
>> > used with it. And I pretty much favor a move to the DIT for the
sake
>> > of completeness : using LDAP to manage itself.
>> >
>> > Let's face the reality : whatever level of semantic you add to a
>> > configuration file, you will _always_ need a good doco and nothing
>> > will replace the RTFM credo...
>> >
>> > My 2cts...
>> >
>> > On 7/3/07, Chris Custine <cc...@apache.org> wrote:
>> >> I could swear I replied to this the night you sent it but
obviously I
>> >> didn't
>> >>  :-)
>> >>
>> >> +1 (caveat below)
>> >>
>> >> I love xbean spring config files because I use ActiveMQ and
ServiceMix
>> >> quite
>> >> a bit and it really does help with some of the verbosity of the
spring
>> >> files.  I think the lack of replies was because we have had
several
>> >> discussions about removing the Spring config file and storing the
>> >> config in
>> >> the DIT which would render this discussion irrelevant.
>> >>
>> >> While we were in Amsterdam I played with the idea of a LDAP Spring
>> >> context
>> >> schema that loaded from LDAP and I have also seen some people
refer to
>> >> loading the context as an xml string from a single LDAP entry.  
>> These are
>> >> all viable options as well.
>> >>
>> >> In the mean time, I am all for using xbean to get some more
mileage
>> >> out of
>> >> the current state of things and maybe this will actually alleviate
>> >> some of
>> >> the complaints about server.xml and I think we should do it sooner

>> rather
>> >> than later.
>> >>
>> >> Chris
>> >>
>> >>
>> >> On 7/2/07, David Jencks <da...@yahoo.com> wrote:
>> >> >
>> >> > On Jul 2, 2007, at 8:32 PM, Aron Sogor wrote:
>> >> >
>> >> > > I am no Spring expert but how would it work for 3rd party
>> >> integration.
>> >> > > When I want to insert my own "private"
Mutable****Configuration?
>> >> > > How would I register those classes...
>> >> > > It would seem to make more difficult.
>> >> >
>> >> > With xbean-spring you can still use standard spring
configuration: I
>> >> > left 2 beans unconverted in the server.xml below to show this.
In
>> >> > fact the original server.xml still works as well, I converted it
a
>> >> > bean at a time and ran everything I could figure out to make
sure it
>> >> > stayed working.  You can also "annotate" your source code and
run 
>> the
>> >> > maven plugin on them to generate a schema (in a different
namespace)
>> >> > and use that to configure your bean with xbean-spring.  I don't
this
>> >> > as being more difficult, but as supplying more options.
>> >> >
>> >> > thanks
>> >> > david jencks
>> >> >
>> >> > >
>> >> > > Aron
>> >> > > David Jencks wrote:
>> >> > >> So does the deafening silence that greeted this mean everyone
is
>> >> > >> so awed by this that they are left speechless? :-)
>> >> > >>
>> >> > >> Seriously, does anyone have any comments on this?  Does
everyone
>> >> > >> prefer the untyped spring style?
>> >> > >>
>> >> > >> On a related note, I've seen a lot of
Mutable****Configuration
>> >> > >> classes in various spots and AFAICT their only purpose is to
>> >> > >> support springs troubles with constructor dependency 
>> injection.  I
>> >> > >> think there's a way to use xbean-spring to make the xml style
as
>> >> > >> below fit into constructor dependency injection.  Any
interest in
>> >> > >> this, or does everyone prefer what's happening now?
>> >> > >>
>> >> > >> thanks
>> >> > >> david jencks
>> >> > >>
>> >> > >>
>> >> > >> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
>> >> > >>
>> >> > >>> A while back there was some discussion of whether server.xml
>> >> > >>> could be made to be more semantically meaningful with less
>> >> > >>> generic cruft, and I suggested looking into xbean-spring.
So, I
>> >> > >>> spent a bit of time on it and implemented this.  See
https://
>> >> > >>> issues.apache.org/jira/browse/DIRSERVER-984
>> >> > >>>
>> >> > >>> This was pretty easy to do, after fixing some problems in
xbean.
>> >> > >>> Basically all I did was add some javadoc "annotations" to
tell
>> >> > >>> xbean which classes to look at and what type collections 
>> contain,
>> >> > >>> and change to the xbean application context from the plain 
>> spring
>> >> > >>> one.
>> >> > >>>
>> >> > >>> xbean generates a schema for the configurable objects so you
can
>> >> > >>> consult the schema to see what can be configured.  As you
can
>> >> > >>> see, you can mix regular spring configuration and the xbean 
>> style
>> >> > >>> in the same server.xml.
>> >> > >>>
>> >> > >>> There's a lot more customization possible, I basically did
the
>> >> > >>> minimum possible to get  it to work.  Pretty much anything
can
>> >> > >>> have a different name.  The main ugliness I see is the
handling
>> >> > >>> of properties that are lists (or sets) of strings.
>> >> > >>>
>> >> > >>> So, at the risk of posting too large a message,  here's the 
>> shiny
>> >> > >>> new server.xml (I removed some commented out bits) :
>> >> > >>>
>> >> > >>> <?xml version="1.0" encoding="UTF-8"?>
>> >> > >>>
>> >> > >>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>> >> > >>>
>> >> "http://www.springframework.org/dtd/spring-beans.dtd">
>> >> > >>>
>> >> > >>> <beans>
>> >> > >>> <!-- bean I didn't convert -->
>> >> > >>>   <bean id="environment"
>> >> > >>>
>> >>
class="org.springframework.beans.factory.config.PropertiesFactoryBea
>> >> > >>> n">
>> >> > >>>     <property name="properties">
>> >> > >>>       <props>
>> >> > >>>         <!-- JNDI security properties used to get initial
>> >> > >>> contexts.         -->
>> >> > >>>         <prop
>> >> key="java.naming.security.authentication ">simple</
>> >> > >>> prop>
>> >> > >>>         <prop
>> >> > >>>
key="java.naming.security.principal">uid=admin,ou=system</prop>
>> >> > >>>         <prop key="
>> >> java.naming.security.credentials">secret</prop>
>> >> > >>>       </props>
>> >> > >>>     </property>
>> >> > >>>   </bean>
>> >> > >>>
>> >> > >>>
>> >> > >>>   <mutableServerStartupConfiguration
>> >> id="configuration"
>> >> > >>> xmlns="http://apacheds.org/config/1.0"
>> >> > >>>
>> >> workingDirectory="example.com "
>> >> > >>>
>> >> synchPeriodMillis="5000"
>> >> > >>>                                      maxThreads="8"
>> >> > >>>
>> >> allowAnonymousAccess="false"
>> >> > >>>
>> >> accessControlEnabled="false"
>> >> > >>>
>> >> > >>> denormalizeOpAttrsEnabled="false"
>> >> > >>>           >
>> >> > >>>     <ntpConfiguration>
>> >> > >>>       <ntpConfiguration
>> >> > >>>               enabled="false"
>> >> > >>>               ipPort="123">
>> >> > >>>       </ntpConfiguration>
>> >> > >>>     </ntpConfiguration>
>> >> > >>>
>> >> > >>>     <dnsConfiguration>
>> >> > >>>       <dnsConfiguration
>> >> > >>>               enabled="false"
>> >> > >>>               ipPort="53">
>> >> > >>>       </dnsConfiguration>
>> >> > >>>     </dnsConfiguration>
>> >> > >>>
>> >> > >>>     <changePasswordConfiguration>
>> >> > >>>       <changePasswordConfiguration
>> >> > >>>               enabled="false"
>> >> > >>>               ipPort="464">
>> >> > >>>       </changePasswordConfiguration>
>> >> > >>>     </changePasswordConfiguration>
>> >> > >>>
>> >> > >>>     <kdcConfiguration>
>> >> > >>>       <kdcConfiguration
>> >> > >>>               enabled="false"
>> >> > >>>               ipPort="88">
>> >> > >>>       </kdcConfiguration>
>> >> > >>>     </kdcConfiguration>
>> >> > >>>
>> >> > >>>     <ldapConfiguration>
>> >> > >>>       <ldapConfiguration id="ldapConfiguration"
>> >> > >>>               ipPort="10389"
>> >> > >>>               allowAnonymousAccess="false"
>> >> > >>>               saslHost="ldap.example.com"
>> >> > >>>
>> >> saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM "
>> >> > >>>               searchBaseDn="ou=users,ou=system"
>> >> > >>>               maxTimeLimit="15000"
>> >> > >>>               maxSizeLimit="1000">
>> >> > >>>
>> >> > >>>         <!-- The list of supported authentication
>> >> > >>> mechanisms.                   -->
>> >> > >>>         <supportedMechanisms>
>> >> > >>>           <value xmlns="
>> >> http://www.springframework.org/schema/
>> >> > >>> beans">SIMPLE</value>
>> >> > >>>           <value xmlns="
>> >> http://www.springframework.org/schema/
>> >> > >>> beans">CRAM-MD5</value>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">DIGEST-MD5</value>
>> >> > >>>           <!--<value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">GSSAPI</value>-->
>> >> > >>>         </supportedMechanisms>
>> >> > >>>
>> >> > >>>         <!-- The desired quality-of-protection, used by
DIGEST-
>> >> > >>> MD5 and GSSAPI.  -->
>> >> > >>>         <saslQop>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">auth</value>
>> >> > >>>           <value xmlns="
>> >> http://www.springframework.org/schema/
>> >> > >>> beans">auth-int</value>
>> >> > >>>           <value xmlns="
>> >> http://www.springframework.org/schema/
>> >> > >>> beans">auth-conf</value>
>> >> > >>>         </saslQop>
>> >> > >>>
>> >> > >>>         <!-- The realms serviced by this SASL host, used by
>> >> > >>> DIGEST-MD5 and GSSAPI. -->
>> >> > >>>         <saslRealms>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">example.com</value>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">apache.org</value>
>> >> > >>>         </saslRealms>
>> >> > >>>
>> >> > >>>         <!-- the collection of extended operation handlers
to
>> >> > >>> install           -->
>> >> > >>>         <extendedOperationHandlers>
>> >> > >>>           <gracefulShutdownHandler/>
>> >> > >>>           <launchDiagnosticUiHandler/>
>> >> > >>>         </extendedOperationHandlers>
>> >> > >>>       </ldapConfiguration>
>> >> > >>>     </ldapConfiguration>
>> >> > >>>
>> >> > >>>     <ldapsConfiguration>
>> >> > >>>       <ldapConfiguration id="ldapsConfiguration"
>> >> > >>>                          enabled="false"
>> >> > >>>                          ipPort="636"
>> >> > >>>                          enableLdaps="true">
>> >> > >>>       </ldapConfiguration>
>> >> > >>>     </ldapsConfiguration>
>> >> > >>>
>> >> > >>>     <systemPartitionConfiguration>
>> >> > >>>       <!-- use the following partitionConfiguration to
override
>> >> > >>> defaults for  -->
>> >> > >>>       <!-- the system
>> >> > >>> partition
>> >>   -->
>> >> > >>>       <mutableBTreePartitionConfiguration
>> >> > >>> id="systemPartitionConfiguration"
>> >> > >>>         name="system"
>> >> > >>>         cacheSize="100"
>> >> > >>>         suffix="ou=system"
>> >> > >>>         optimizerEnabled="true"
>> >> > >>>         synchOnWrite="true">
>> >> > >>>         <indexedAttributes>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="ou"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="uid"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="objectClass"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>         </indexedAttributes>
>> >> > >>>         <contextEntry>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">
>> >> > >>>             objectClass: top
>> >> > >>>             objectClass: organizationalUnit
>> >> > >>>             objectClass: extensibleObject
>> >> > >>>             ou: system
>> >> > >>>           </value>
>> >> > >>>         </contextEntry>
>> >> > >>>       </mutableBTreePartitionConfiguration>
>> >> > >>>     </systemPartitionConfiguration>
>> >> > >>>
>> >> > >>>     <partitionConfigurations>
>> >> > >>>       <mutableBTreePartitionConfiguration
>> >> > >>> id="examplePartitionConfiguration"
>> >> > >>>         name="example"
>> >> > >>>         cacheSize="100"
>> >> > >>>         suffix="dc=example,dc=com"
>> >> > >>>         optimizerEnabled="true"
>> >> > >>>         synchOnWrite="true">
>> >> > >>>         <indexedAttributes>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="dc"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="ou"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="krb5PrincipalName"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="uid"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="objectClass"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>         </indexedAttributes>
>> >> > >>>         <contextEntry>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">
>> >> > >>>             objectClass: top
>> >> > >>>             objectClass: domain
>> >> > >>>             objectClass: extensibleObject
>> >> > >>>             dc: example
>> >> > >>>           </value>
>> >> > >>>         </contextEntry>
>> >> > >>>       </mutableBTreePartitionConfiguration>
>> >> > >>>     </partitionConfigurations>
>> >> > >>>
>> >> > >>>     <interceptorConfigurations>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="normalizationService">
>> >> > >>>         <interceptor>
>> >> > >>>           <normalizationService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="authenticationService">
>> >> > >>>         <interceptor>
>> >> > >>>           <authenticationService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="referralService">
>> >> > >>>         <interceptor>
>> >> > >>>           <referralService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="authorizationService">
>> >> > >>>         <interceptor>
>> >> > >>>           <authorizationService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="defaultAuthorizationService">
>> >> > >>>         <interceptor>
>> >> > >>>           <defaultAuthorizationService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="exceptionService">
>> >> > >>>         <interceptor>
>> >> > >>>           <exceptionService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="operationalAttributeService">
>> >> > >>>         <interceptor>
>> >> > >>>           <operationalAttributeService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="schemaService">
>> >> > >>>         <interceptor>
>> >> > >>>           <schemaService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="subentryService">
>> >> > >>>         <interceptor>
>> >> > >>>           <subentryService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="collectiveAttributeService">
>> >> > >>>         <interceptor>
>> >> > >>>           <collectiveAttributeService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="eventService">
>> >> > >>>         <interceptor>
>> >> > >>>           <eventService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="triggerService">
>> >> > >>>         <interceptor>
>> >> > >>>           <triggerService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>
>> >> > >>>     </interceptorConfigurations>
>> >> > >>>   </mutableServerStartupConfiguration>
>> >> > >>>
>> >> > >>>
>> >> > >>> <!-- another bean I didn't convert -->
>> >> > >>>   <bean
>> >> > >>>
>> >>
class="org.springframework.beans.factory.config.CustomEditorConfigur
>> >> > >>> er">
>> >> > >>>     <property name="customEditors">
>> >> > >>>       <map>
>> >> > >>>         <entry
>> >> key="javax.naming.directory.Attributes">
>> >> > >>>           <bean
>> >> > >>>
>> >>
class="org.apache.directory.server.core.configuration.AttributesProp
>> >> > >>> ertyEditor"/>
>> >> > >>>         </entry>
>> >> > >>>       </map>
>> >> > >>>     </property>
>> >> > >>>   </bean>
>> >> > >>> </beans>
>> >> > >>>
>> >> > >>>
>> >> > >>> Comments?
>> >> > >>>
>> >> > >>> thanks
>> >> > >>> david jencks
>> >> > >>>
>> >> > >>>
>> >> > >>
>> >> > >>
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
> 
> 
***************************************************************************************************
The information in this email is confidential and may be legally privileged. Access to this email by anyone other than the intended addressee is unauthorized. If you are not the intended recipient of this message, any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you are not the intended recipient, please reply to or forward a copy of this message to the sender and delete the message, any attachments, and any copies thereof from your system.
***************************************************************************************************

Re: Simplified server configuration with xbean-spring

Posted by Ole Ersoy <ol...@gmail.com>.
Cocktail.  I'll even throw in an Olive :-)  Maybe it should simplify a little more though.  We already have spring beans (Pojos).  The code generated from the EMF model is the same thing.  So think of the EMF model as the spring POJOs, with the additional xml semantics that Xbean brings.  Now we also want to store this model in ADS, and the DAS is an elegant way of doing this, as well as performing CRUD operations on server configuration entries.  Make more sense?

Cheers,
- Ole



Ersin Er wrote:
> On 7/3/07, Ole Ersoy <ol...@gmail.com> wrote:
>> OK - I'll just throw one more idea into the mix.
>>
>> Model the configuration file using xml schema.  Generate an EMF Model 
>> for it (This way serialized model instances conform to the schema 
>> keeping the semantic meaning intact).  Set the configuration defaults 
>> on the EMF Model.  Use the LDAP DAS to store the default entries in 
>> ApacheDS.  Now when ADS starts, it reads the configuration entries via 
>> the LDAP DAS and loads the corresponding EMF Model.  LS would also 
>> read the configuration file via the LDAP DAS and display it to the 
>> user for updates.  Then LS can save it to it's xml representation, 
>> reload it (Later if needed), and be the client for handling server 
>> updates.  Thoughts?
> 
> So this is for simplifying things or making a technology cocktail ?
> 
>> Cheers,
>> - Ole
>>
>>
>> Emmanuel Lecharny wrote:
>> > Hi guys,
>> >
>> > sorry for the "deafening silence" ... We were quite busy those last
>> > days, up to a point we let this important mail dying silently ...
>> >
>> > ok, I agree with David that the current server.xml is, to say the
>> > least, not very easy to handle, as it does not carry a lot of
>> > semantic.
>> >
>> > Now, from our users perspective, we have two problems :
>> > 1) current users don't manipulate a lot this file, as you don't fix
>> > something which work, as soon as it's complicated to male it work
>> > again, due to the complexity of the current configuration file ( kind
>> > of circular situation ... )
>> > 2) new users are simply afraid to touch this configuration file,
>> > because it's too complex...
>> >
>> > We have two ideas to help solving those problems :
>> > 1) Apache Directory Studio contains a GUI which helps to manupulate
>> > this file. Not sure that users are aware of that ...
>> > 2) we really want to move almost all of this configuration into the
>> > DIT in the next few months, so that we will be able to avoid having
>> > such a massive configuration file
>> >
>> > The second solution will obviously be coupled with a new version of
>> > the first one.
>> >
>> > I would add that there is no good solution to such a problem. We went
>> > from property file to spring configuration because the property file
>> > was ugly and didn't carried enough semantic. Now it's the same problem
>> > again. Pushing all the configuration into the DIT won't add extra
>> > semantic... This is a dead end. Wat I would suggest in this case is
>> > the least we change the configuration, the more likely users will get
>> > used with it. And I pretty much favor a move to the DIT for the sake
>> > of completeness : using LDAP to manage itself.
>> >
>> > Let's face the reality : whatever level of semantic you add to a
>> > configuration file, you will _always_ need a good doco and nothing
>> > will replace the RTFM credo...
>> >
>> > My 2cts...
>> >
>> > On 7/3/07, Chris Custine <cc...@apache.org> wrote:
>> >> I could swear I replied to this the night you sent it but obviously I
>> >> didn't
>> >>  :-)
>> >>
>> >> +1 (caveat below)
>> >>
>> >> I love xbean spring config files because I use ActiveMQ and ServiceMix
>> >> quite
>> >> a bit and it really does help with some of the verbosity of the spring
>> >> files.  I think the lack of replies was because we have had several
>> >> discussions about removing the Spring config file and storing the
>> >> config in
>> >> the DIT which would render this discussion irrelevant.
>> >>
>> >> While we were in Amsterdam I played with the idea of a LDAP Spring
>> >> context
>> >> schema that loaded from LDAP and I have also seen some people refer to
>> >> loading the context as an xml string from a single LDAP entry.  
>> These are
>> >> all viable options as well.
>> >>
>> >> In the mean time, I am all for using xbean to get some more mileage
>> >> out of
>> >> the current state of things and maybe this will actually alleviate
>> >> some of
>> >> the complaints about server.xml and I think we should do it sooner 
>> rather
>> >> than later.
>> >>
>> >> Chris
>> >>
>> >>
>> >> On 7/2/07, David Jencks <da...@yahoo.com> wrote:
>> >> >
>> >> > On Jul 2, 2007, at 8:32 PM, Aron Sogor wrote:
>> >> >
>> >> > > I am no Spring expert but how would it work for 3rd party
>> >> integration.
>> >> > > When I want to insert my own "private" Mutable****Configuration?
>> >> > > How would I register those classes...
>> >> > > It would seem to make more difficult.
>> >> >
>> >> > With xbean-spring you can still use standard spring configuration: I
>> >> > left 2 beans unconverted in the server.xml below to show this. In
>> >> > fact the original server.xml still works as well, I converted it a
>> >> > bean at a time and ran everything I could figure out to make sure it
>> >> > stayed working.  You can also "annotate" your source code and run 
>> the
>> >> > maven plugin on them to generate a schema (in a different namespace)
>> >> > and use that to configure your bean with xbean-spring.  I don't this
>> >> > as being more difficult, but as supplying more options.
>> >> >
>> >> > thanks
>> >> > david jencks
>> >> >
>> >> > >
>> >> > > Aron
>> >> > > David Jencks wrote:
>> >> > >> So does the deafening silence that greeted this mean everyone is
>> >> > >> so awed by this that they are left speechless? :-)
>> >> > >>
>> >> > >> Seriously, does anyone have any comments on this?  Does everyone
>> >> > >> prefer the untyped spring style?
>> >> > >>
>> >> > >> On a related note, I've seen a lot of Mutable****Configuration
>> >> > >> classes in various spots and AFAICT their only purpose is to
>> >> > >> support springs troubles with constructor dependency 
>> injection.  I
>> >> > >> think there's a way to use xbean-spring to make the xml style as
>> >> > >> below fit into constructor dependency injection.  Any interest in
>> >> > >> this, or does everyone prefer what's happening now?
>> >> > >>
>> >> > >> thanks
>> >> > >> david jencks
>> >> > >>
>> >> > >>
>> >> > >> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
>> >> > >>
>> >> > >>> A while back there was some discussion of whether server.xml
>> >> > >>> could be made to be more semantically meaningful with less
>> >> > >>> generic cruft, and I suggested looking into xbean-spring.  So, I
>> >> > >>> spent a bit of time on it and implemented this.  See https://
>> >> > >>> issues.apache.org/jira/browse/DIRSERVER-984
>> >> > >>>
>> >> > >>> This was pretty easy to do, after fixing some problems in xbean.
>> >> > >>> Basically all I did was add some javadoc "annotations" to tell
>> >> > >>> xbean which classes to look at and what type collections 
>> contain,
>> >> > >>> and change to the xbean application context from the plain 
>> spring
>> >> > >>> one.
>> >> > >>>
>> >> > >>> xbean generates a schema for the configurable objects so you can
>> >> > >>> consult the schema to see what can be configured.  As you can
>> >> > >>> see, you can mix regular spring configuration and the xbean 
>> style
>> >> > >>> in the same server.xml.
>> >> > >>>
>> >> > >>> There's a lot more customization possible, I basically did the
>> >> > >>> minimum possible to get  it to work.  Pretty much anything can
>> >> > >>> have a different name.  The main ugliness I see is the handling
>> >> > >>> of properties that are lists (or sets) of strings.
>> >> > >>>
>> >> > >>> So, at the risk of posting too large a message,  here's the 
>> shiny
>> >> > >>> new server.xml (I removed some commented out bits) :
>> >> > >>>
>> >> > >>> <?xml version="1.0" encoding="UTF-8"?>
>> >> > >>>
>> >> > >>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>> >> > >>>
>> >> "http://www.springframework.org/dtd/spring-beans.dtd">
>> >> > >>>
>> >> > >>> <beans>
>> >> > >>> <!-- bean I didn't convert -->
>> >> > >>>   <bean id="environment"
>> >> > >>>
>> >> class="org.springframework.beans.factory.config.PropertiesFactoryBea
>> >> > >>> n">
>> >> > >>>     <property name="properties">
>> >> > >>>       <props>
>> >> > >>>         <!-- JNDI security properties used to get initial
>> >> > >>> contexts.         -->
>> >> > >>>         <prop
>> >> key="java.naming.security.authentication ">simple</
>> >> > >>> prop>
>> >> > >>>         <prop
>> >> > >>> key="java.naming.security.principal">uid=admin,ou=system</prop>
>> >> > >>>         <prop key="
>> >> java.naming.security.credentials">secret</prop>
>> >> > >>>       </props>
>> >> > >>>     </property>
>> >> > >>>   </bean>
>> >> > >>>
>> >> > >>>
>> >> > >>>   <mutableServerStartupConfiguration
>> >> id="configuration"
>> >> > >>> xmlns="http://apacheds.org/config/1.0"
>> >> > >>>
>> >> workingDirectory="example.com "
>> >> > >>>
>> >> synchPeriodMillis="5000"
>> >> > >>>                                      maxThreads="8"
>> >> > >>>
>> >> allowAnonymousAccess="false"
>> >> > >>>
>> >> accessControlEnabled="false"
>> >> > >>>
>> >> > >>> denormalizeOpAttrsEnabled="false"
>> >> > >>>           >
>> >> > >>>     <ntpConfiguration>
>> >> > >>>       <ntpConfiguration
>> >> > >>>               enabled="false"
>> >> > >>>               ipPort="123">
>> >> > >>>       </ntpConfiguration>
>> >> > >>>     </ntpConfiguration>
>> >> > >>>
>> >> > >>>     <dnsConfiguration>
>> >> > >>>       <dnsConfiguration
>> >> > >>>               enabled="false"
>> >> > >>>               ipPort="53">
>> >> > >>>       </dnsConfiguration>
>> >> > >>>     </dnsConfiguration>
>> >> > >>>
>> >> > >>>     <changePasswordConfiguration>
>> >> > >>>       <changePasswordConfiguration
>> >> > >>>               enabled="false"
>> >> > >>>               ipPort="464">
>> >> > >>>       </changePasswordConfiguration>
>> >> > >>>     </changePasswordConfiguration>
>> >> > >>>
>> >> > >>>     <kdcConfiguration>
>> >> > >>>       <kdcConfiguration
>> >> > >>>               enabled="false"
>> >> > >>>               ipPort="88">
>> >> > >>>       </kdcConfiguration>
>> >> > >>>     </kdcConfiguration>
>> >> > >>>
>> >> > >>>     <ldapConfiguration>
>> >> > >>>       <ldapConfiguration id="ldapConfiguration"
>> >> > >>>               ipPort="10389"
>> >> > >>>               allowAnonymousAccess="false"
>> >> > >>>               saslHost="ldap.example.com"
>> >> > >>>
>> >> saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM "
>> >> > >>>               searchBaseDn="ou=users,ou=system"
>> >> > >>>               maxTimeLimit="15000"
>> >> > >>>               maxSizeLimit="1000">
>> >> > >>>
>> >> > >>>         <!-- The list of supported authentication
>> >> > >>> mechanisms.                   -->
>> >> > >>>         <supportedMechanisms>
>> >> > >>>           <value xmlns="
>> >> http://www.springframework.org/schema/
>> >> > >>> beans">SIMPLE</value>
>> >> > >>>           <value xmlns="
>> >> http://www.springframework.org/schema/
>> >> > >>> beans">CRAM-MD5</value>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">DIGEST-MD5</value>
>> >> > >>>           <!--<value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">GSSAPI</value>-->
>> >> > >>>         </supportedMechanisms>
>> >> > >>>
>> >> > >>>         <!-- The desired quality-of-protection, used by DIGEST-
>> >> > >>> MD5 and GSSAPI.  -->
>> >> > >>>         <saslQop>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">auth</value>
>> >> > >>>           <value xmlns="
>> >> http://www.springframework.org/schema/
>> >> > >>> beans">auth-int</value>
>> >> > >>>           <value xmlns="
>> >> http://www.springframework.org/schema/
>> >> > >>> beans">auth-conf</value>
>> >> > >>>         </saslQop>
>> >> > >>>
>> >> > >>>         <!-- The realms serviced by this SASL host, used by
>> >> > >>> DIGEST-MD5 and GSSAPI. -->
>> >> > >>>         <saslRealms>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">example.com</value>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">apache.org</value>
>> >> > >>>         </saslRealms>
>> >> > >>>
>> >> > >>>         <!-- the collection of extended operation handlers to
>> >> > >>> install           -->
>> >> > >>>         <extendedOperationHandlers>
>> >> > >>>           <gracefulShutdownHandler/>
>> >> > >>>           <launchDiagnosticUiHandler/>
>> >> > >>>         </extendedOperationHandlers>
>> >> > >>>       </ldapConfiguration>
>> >> > >>>     </ldapConfiguration>
>> >> > >>>
>> >> > >>>     <ldapsConfiguration>
>> >> > >>>       <ldapConfiguration id="ldapsConfiguration"
>> >> > >>>                          enabled="false"
>> >> > >>>                          ipPort="636"
>> >> > >>>                          enableLdaps="true">
>> >> > >>>       </ldapConfiguration>
>> >> > >>>     </ldapsConfiguration>
>> >> > >>>
>> >> > >>>     <systemPartitionConfiguration>
>> >> > >>>       <!-- use the following partitionConfiguration to override
>> >> > >>> defaults for  -->
>> >> > >>>       <!-- the system
>> >> > >>> partition
>> >>   -->
>> >> > >>>       <mutableBTreePartitionConfiguration
>> >> > >>> id="systemPartitionConfiguration"
>> >> > >>>         name="system"
>> >> > >>>         cacheSize="100"
>> >> > >>>         suffix="ou=system"
>> >> > >>>         optimizerEnabled="true"
>> >> > >>>         synchOnWrite="true">
>> >> > >>>         <indexedAttributes>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="ou"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="uid"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="objectClass"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>         </indexedAttributes>
>> >> > >>>         <contextEntry>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">
>> >> > >>>             objectClass: top
>> >> > >>>             objectClass: organizationalUnit
>> >> > >>>             objectClass: extensibleObject
>> >> > >>>             ou: system
>> >> > >>>           </value>
>> >> > >>>         </contextEntry>
>> >> > >>>       </mutableBTreePartitionConfiguration>
>> >> > >>>     </systemPartitionConfiguration>
>> >> > >>>
>> >> > >>>     <partitionConfigurations>
>> >> > >>>       <mutableBTreePartitionConfiguration
>> >> > >>> id="examplePartitionConfiguration"
>> >> > >>>         name="example"
>> >> > >>>         cacheSize="100"
>> >> > >>>         suffix="dc=example,dc=com"
>> >> > >>>         optimizerEnabled="true"
>> >> > >>>         synchOnWrite="true">
>> >> > >>>         <indexedAttributes>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>> >> > >>>               cacheSize="10"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="dc"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="ou"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="krb5PrincipalName"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="uid"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>             <mutableIndexConfiguration
>> >> > >>>               attributeId="objectClass"
>> >> > >>>               cacheSize="100"/>
>> >> > >>>         </indexedAttributes>
>> >> > >>>         <contextEntry>
>> >> > >>>           <value
>> >> xmlns="http://www.springframework.org/schema/
>> >> > >>> beans">
>> >> > >>>             objectClass: top
>> >> > >>>             objectClass: domain
>> >> > >>>             objectClass: extensibleObject
>> >> > >>>             dc: example
>> >> > >>>           </value>
>> >> > >>>         </contextEntry>
>> >> > >>>       </mutableBTreePartitionConfiguration>
>> >> > >>>     </partitionConfigurations>
>> >> > >>>
>> >> > >>>     <interceptorConfigurations>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="normalizationService">
>> >> > >>>         <interceptor>
>> >> > >>>           <normalizationService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="authenticationService">
>> >> > >>>         <interceptor>
>> >> > >>>           <authenticationService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="referralService">
>> >> > >>>         <interceptor>
>> >> > >>>           <referralService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="authorizationService">
>> >> > >>>         <interceptor>
>> >> > >>>           <authorizationService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="defaultAuthorizationService">
>> >> > >>>         <interceptor>
>> >> > >>>           <defaultAuthorizationService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="exceptionService">
>> >> > >>>         <interceptor>
>> >> > >>>           <exceptionService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="operationalAttributeService">
>> >> > >>>         <interceptor>
>> >> > >>>           <operationalAttributeService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="schemaService">
>> >> > >>>         <interceptor>
>> >> > >>>           <schemaService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="subentryService">
>> >> > >>>         <interceptor>
>> >> > >>>           <subentryService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="collectiveAttributeService">
>> >> > >>>         <interceptor>
>> >> > >>>           <collectiveAttributeService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="eventService">
>> >> > >>>         <interceptor>
>> >> > >>>           <eventService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>       <mutableInterceptorConfiguration
>> >> > >>>               name="triggerService">
>> >> > >>>         <interceptor>
>> >> > >>>           <triggerService/>
>> >> > >>>         </interceptor>
>> >> > >>>       </mutableInterceptorConfiguration>
>> >> > >>>
>> >> > >>>     </interceptorConfigurations>
>> >> > >>>   </mutableServerStartupConfiguration>
>> >> > >>>
>> >> > >>>
>> >> > >>> <!-- another bean I didn't convert -->
>> >> > >>>   <bean
>> >> > >>>
>> >> class="org.springframework.beans.factory.config.CustomEditorConfigur
>> >> > >>> er">
>> >> > >>>     <property name="customEditors">
>> >> > >>>       <map>
>> >> > >>>         <entry
>> >> key="javax.naming.directory.Attributes">
>> >> > >>>           <bean
>> >> > >>>
>> >> class="org.apache.directory.server.core.configuration.AttributesProp
>> >> > >>> ertyEditor"/>
>> >> > >>>         </entry>
>> >> > >>>       </map>
>> >> > >>>     </property>
>> >> > >>>   </bean>
>> >> > >>> </beans>
>> >> > >>>
>> >> > >>>
>> >> > >>> Comments?
>> >> > >>>
>> >> > >>> thanks
>> >> > >>> david jencks
>> >> > >>>
>> >> > >>>
>> >> > >>
>> >> > >>
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
> 
> 

Re: Simplified server configuration with xbean-spring

Posted by Ole Ersoy <ol...@gmail.com>.
Thanks :-)  I figured I'd throw it out there.  I can understand if it sounds like a plan to setup a space station on the moon though  :-)  To me it's the simplest and most elegant solution wrt storing configuration data in ADS and reading it from clients and ADS through a standardized Object - Hierarchical mapping layer.  The reason it's a good thing is that it would allow us to simply update the XML Schema, regenerate the model, and the rest of the integration is taken care of (Along with the semantics that the XML configuration is communicating).  No need to write additional code to store or retrieve configuration entries.  Thus we would take care of both ADS and LS in one shot, as well as any other client (Web...) wishing to read configuration data from ADS through a standardized layer.  For ADS the only thing that would change is the switch to "EMF Beans" rather than "Spring Beans".  Anyways just something to be aware of.

Sorry I high jacked the XBean thread David.  I'm still a fan :-)

Cheers,
- Ole



Emmanuel Lecharny wrote:
>> So this is for simplifying things or making a technology cocktail ?
> 
> Arf !!! Ersin, I *like* your sense of humour :)
> 
> Ole, frankly, I'm not really sure that your proposal will gain a lot
> of traction ! Except the idea of designing a XML schema, everything
> else would be a little bit overkilling ...
> 
> What we are trying to do is simply to get rid of the atrocious XML
> file, but it will take time... (and anyway, I say 'atrocious', but I
> don't mean it... At some point, when you want a versatile server, you
> need more configuration. What suggested David was pretty OK, but as we
> are moving to DIT, I just don't think it worths the pain it will
> inflict to users ).
> 
> Anyway, good try Ole :)
> 

Re: Simplified server configuration with xbean-spring

Posted by Emmanuel Lecharny <el...@gmail.com>.
> So this is for simplifying things or making a technology cocktail ?

Arf !!! Ersin, I *like* your sense of humour :)

Ole, frankly, I'm not really sure that your proposal will gain a lot
of traction ! Except the idea of designing a XML schema, everything
else would be a little bit overkilling ...

What we are trying to do is simply to get rid of the atrocious XML
file, but it will take time... (and anyway, I say 'atrocious', but I
don't mean it... At some point, when you want a versatile server, you
need more configuration. What suggested David was pretty OK, but as we
are moving to DIT, I just don't think it worths the pain it will
inflict to users ).

Anyway, good try Ole :)

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: Simplified server configuration with xbean-spring

Posted by Ersin Er <er...@gmail.com>.
On 7/3/07, Ole Ersoy <ol...@gmail.com> wrote:
> OK - I'll just throw one more idea into the mix.
>
> Model the configuration file using xml schema.  Generate an EMF Model for it (This way serialized model instances conform to the schema keeping the semantic meaning intact).  Set the configuration defaults on the EMF Model.  Use the LDAP DAS to store the default entries in ApacheDS.  Now when ADS starts, it reads the configuration entries via the LDAP DAS and loads the corresponding EMF Model.  LS would also read the configuration file via the LDAP DAS and display it to the user for updates.  Then LS can save it to it's xml representation, reload it (Later if needed), and be the client for handling server updates.  Thoughts?

So this is for simplifying things or making a technology cocktail ?

> Cheers,
> - Ole
>
>
> Emmanuel Lecharny wrote:
> > Hi guys,
> >
> > sorry for the "deafening silence" ... We were quite busy those last
> > days, up to a point we let this important mail dying silently ...
> >
> > ok, I agree with David that the current server.xml is, to say the
> > least, not very easy to handle, as it does not carry a lot of
> > semantic.
> >
> > Now, from our users perspective, we have two problems :
> > 1) current users don't manipulate a lot this file, as you don't fix
> > something which work, as soon as it's complicated to male it work
> > again, due to the complexity of the current configuration file ( kind
> > of circular situation ... )
> > 2) new users are simply afraid to touch this configuration file,
> > because it's too complex...
> >
> > We have two ideas to help solving those problems :
> > 1) Apache Directory Studio contains a GUI which helps to manupulate
> > this file. Not sure that users are aware of that ...
> > 2) we really want to move almost all of this configuration into the
> > DIT in the next few months, so that we will be able to avoid having
> > such a massive configuration file
> >
> > The second solution will obviously be coupled with a new version of
> > the first one.
> >
> > I would add that there is no good solution to such a problem. We went
> > from property file to spring configuration because the property file
> > was ugly and didn't carried enough semantic. Now it's the same problem
> > again. Pushing all the configuration into the DIT won't add extra
> > semantic... This is a dead end. Wat I would suggest in this case is
> > the least we change the configuration, the more likely users will get
> > used with it. And I pretty much favor a move to the DIT for the sake
> > of completeness : using LDAP to manage itself.
> >
> > Let's face the reality : whatever level of semantic you add to a
> > configuration file, you will _always_ need a good doco and nothing
> > will replace the RTFM credo...
> >
> > My 2cts...
> >
> > On 7/3/07, Chris Custine <cc...@apache.org> wrote:
> >> I could swear I replied to this the night you sent it but obviously I
> >> didn't
> >>  :-)
> >>
> >> +1 (caveat below)
> >>
> >> I love xbean spring config files because I use ActiveMQ and ServiceMix
> >> quite
> >> a bit and it really does help with some of the verbosity of the spring
> >> files.  I think the lack of replies was because we have had several
> >> discussions about removing the Spring config file and storing the
> >> config in
> >> the DIT which would render this discussion irrelevant.
> >>
> >> While we were in Amsterdam I played with the idea of a LDAP Spring
> >> context
> >> schema that loaded from LDAP and I have also seen some people refer to
> >> loading the context as an xml string from a single LDAP entry.  These are
> >> all viable options as well.
> >>
> >> In the mean time, I am all for using xbean to get some more mileage
> >> out of
> >> the current state of things and maybe this will actually alleviate
> >> some of
> >> the complaints about server.xml and I think we should do it sooner rather
> >> than later.
> >>
> >> Chris
> >>
> >>
> >> On 7/2/07, David Jencks <da...@yahoo.com> wrote:
> >> >
> >> > On Jul 2, 2007, at 8:32 PM, Aron Sogor wrote:
> >> >
> >> > > I am no Spring expert but how would it work for 3rd party
> >> integration.
> >> > > When I want to insert my own "private" Mutable****Configuration?
> >> > > How would I register those classes...
> >> > > It would seem to make more difficult.
> >> >
> >> > With xbean-spring you can still use standard spring configuration: I
> >> > left 2 beans unconverted in the server.xml below to show this. In
> >> > fact the original server.xml still works as well, I converted it a
> >> > bean at a time and ran everything I could figure out to make sure it
> >> > stayed working.  You can also "annotate" your source code and run the
> >> > maven plugin on them to generate a schema (in a different namespace)
> >> > and use that to configure your bean with xbean-spring.  I don't this
> >> > as being more difficult, but as supplying more options.
> >> >
> >> > thanks
> >> > david jencks
> >> >
> >> > >
> >> > > Aron
> >> > > David Jencks wrote:
> >> > >> So does the deafening silence that greeted this mean everyone is
> >> > >> so awed by this that they are left speechless? :-)
> >> > >>
> >> > >> Seriously, does anyone have any comments on this?  Does everyone
> >> > >> prefer the untyped spring style?
> >> > >>
> >> > >> On a related note, I've seen a lot of Mutable****Configuration
> >> > >> classes in various spots and AFAICT their only purpose is to
> >> > >> support springs troubles with constructor dependency injection.  I
> >> > >> think there's a way to use xbean-spring to make the xml style as
> >> > >> below fit into constructor dependency injection.  Any interest in
> >> > >> this, or does everyone prefer what's happening now?
> >> > >>
> >> > >> thanks
> >> > >> david jencks
> >> > >>
> >> > >>
> >> > >> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
> >> > >>
> >> > >>> A while back there was some discussion of whether server.xml
> >> > >>> could be made to be more semantically meaningful with less
> >> > >>> generic cruft, and I suggested looking into xbean-spring.  So, I
> >> > >>> spent a bit of time on it and implemented this.  See https://
> >> > >>> issues.apache.org/jira/browse/DIRSERVER-984
> >> > >>>
> >> > >>> This was pretty easy to do, after fixing some problems in xbean.
> >> > >>> Basically all I did was add some javadoc "annotations" to tell
> >> > >>> xbean which classes to look at and what type collections contain,
> >> > >>> and change to the xbean application context from the plain spring
> >> > >>> one.
> >> > >>>
> >> > >>> xbean generates a schema for the configurable objects so you can
> >> > >>> consult the schema to see what can be configured.  As you can
> >> > >>> see, you can mix regular spring configuration and the xbean style
> >> > >>> in the same server.xml.
> >> > >>>
> >> > >>> There's a lot more customization possible, I basically did the
> >> > >>> minimum possible to get  it to work.  Pretty much anything can
> >> > >>> have a different name.  The main ugliness I see is the handling
> >> > >>> of properties that are lists (or sets) of strings.
> >> > >>>
> >> > >>> So, at the risk of posting too large a message,  here's the shiny
> >> > >>> new server.xml (I removed some commented out bits) :
> >> > >>>
> >> > >>> <?xml version="1.0" encoding="UTF-8"?>
> >> > >>>
> >> > >>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> >> > >>>
> >> "http://www.springframework.org/dtd/spring-beans.dtd">
> >> > >>>
> >> > >>> <beans>
> >> > >>> <!-- bean I didn't convert -->
> >> > >>>   <bean id="environment"
> >> > >>>
> >> class="org.springframework.beans.factory.config.PropertiesFactoryBea
> >> > >>> n">
> >> > >>>     <property name="properties">
> >> > >>>       <props>
> >> > >>>         <!-- JNDI security properties used to get initial
> >> > >>> contexts.         -->
> >> > >>>         <prop
> >> key="java.naming.security.authentication ">simple</
> >> > >>> prop>
> >> > >>>         <prop
> >> > >>> key="java.naming.security.principal">uid=admin,ou=system</prop>
> >> > >>>         <prop key="
> >> java.naming.security.credentials">secret</prop>
> >> > >>>       </props>
> >> > >>>     </property>
> >> > >>>   </bean>
> >> > >>>
> >> > >>>
> >> > >>>   <mutableServerStartupConfiguration
> >> id="configuration"
> >> > >>> xmlns="http://apacheds.org/config/1.0"
> >> > >>>
> >> workingDirectory="example.com "
> >> > >>>
> >> synchPeriodMillis="5000"
> >> > >>>                                      maxThreads="8"
> >> > >>>
> >> allowAnonymousAccess="false"
> >> > >>>
> >> accessControlEnabled="false"
> >> > >>>
> >> > >>> denormalizeOpAttrsEnabled="false"
> >> > >>>           >
> >> > >>>     <ntpConfiguration>
> >> > >>>       <ntpConfiguration
> >> > >>>               enabled="false"
> >> > >>>               ipPort="123">
> >> > >>>       </ntpConfiguration>
> >> > >>>     </ntpConfiguration>
> >> > >>>
> >> > >>>     <dnsConfiguration>
> >> > >>>       <dnsConfiguration
> >> > >>>               enabled="false"
> >> > >>>               ipPort="53">
> >> > >>>       </dnsConfiguration>
> >> > >>>     </dnsConfiguration>
> >> > >>>
> >> > >>>     <changePasswordConfiguration>
> >> > >>>       <changePasswordConfiguration
> >> > >>>               enabled="false"
> >> > >>>               ipPort="464">
> >> > >>>       </changePasswordConfiguration>
> >> > >>>     </changePasswordConfiguration>
> >> > >>>
> >> > >>>     <kdcConfiguration>
> >> > >>>       <kdcConfiguration
> >> > >>>               enabled="false"
> >> > >>>               ipPort="88">
> >> > >>>       </kdcConfiguration>
> >> > >>>     </kdcConfiguration>
> >> > >>>
> >> > >>>     <ldapConfiguration>
> >> > >>>       <ldapConfiguration id="ldapConfiguration"
> >> > >>>               ipPort="10389"
> >> > >>>               allowAnonymousAccess="false"
> >> > >>>               saslHost="ldap.example.com"
> >> > >>>
> >> saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM "
> >> > >>>               searchBaseDn="ou=users,ou=system"
> >> > >>>               maxTimeLimit="15000"
> >> > >>>               maxSizeLimit="1000">
> >> > >>>
> >> > >>>         <!-- The list of supported authentication
> >> > >>> mechanisms.                   -->
> >> > >>>         <supportedMechanisms>
> >> > >>>           <value xmlns="
> >> http://www.springframework.org/schema/
> >> > >>> beans">SIMPLE</value>
> >> > >>>           <value xmlns="
> >> http://www.springframework.org/schema/
> >> > >>> beans">CRAM-MD5</value>
> >> > >>>           <value
> >> xmlns="http://www.springframework.org/schema/
> >> > >>> beans">DIGEST-MD5</value>
> >> > >>>           <!--<value
> >> xmlns="http://www.springframework.org/schema/
> >> > >>> beans">GSSAPI</value>-->
> >> > >>>         </supportedMechanisms>
> >> > >>>
> >> > >>>         <!-- The desired quality-of-protection, used by DIGEST-
> >> > >>> MD5 and GSSAPI.  -->
> >> > >>>         <saslQop>
> >> > >>>           <value
> >> xmlns="http://www.springframework.org/schema/
> >> > >>> beans">auth</value>
> >> > >>>           <value xmlns="
> >> http://www.springframework.org/schema/
> >> > >>> beans">auth-int</value>
> >> > >>>           <value xmlns="
> >> http://www.springframework.org/schema/
> >> > >>> beans">auth-conf</value>
> >> > >>>         </saslQop>
> >> > >>>
> >> > >>>         <!-- The realms serviced by this SASL host, used by
> >> > >>> DIGEST-MD5 and GSSAPI. -->
> >> > >>>         <saslRealms>
> >> > >>>           <value
> >> xmlns="http://www.springframework.org/schema/
> >> > >>> beans">example.com</value>
> >> > >>>           <value
> >> xmlns="http://www.springframework.org/schema/
> >> > >>> beans">apache.org</value>
> >> > >>>         </saslRealms>
> >> > >>>
> >> > >>>         <!-- the collection of extended operation handlers to
> >> > >>> install           -->
> >> > >>>         <extendedOperationHandlers>
> >> > >>>           <gracefulShutdownHandler/>
> >> > >>>           <launchDiagnosticUiHandler/>
> >> > >>>         </extendedOperationHandlers>
> >> > >>>       </ldapConfiguration>
> >> > >>>     </ldapConfiguration>
> >> > >>>
> >> > >>>     <ldapsConfiguration>
> >> > >>>       <ldapConfiguration id="ldapsConfiguration"
> >> > >>>                          enabled="false"
> >> > >>>                          ipPort="636"
> >> > >>>                          enableLdaps="true">
> >> > >>>       </ldapConfiguration>
> >> > >>>     </ldapsConfiguration>
> >> > >>>
> >> > >>>     <systemPartitionConfiguration>
> >> > >>>       <!-- use the following partitionConfiguration to override
> >> > >>> defaults for  -->
> >> > >>>       <!-- the system
> >> > >>> partition
> >>   -->
> >> > >>>       <mutableBTreePartitionConfiguration
> >> > >>> id="systemPartitionConfiguration"
> >> > >>>         name="system"
> >> > >>>         cacheSize="100"
> >> > >>>         suffix="ou=system"
> >> > >>>         optimizerEnabled="true"
> >> > >>>         synchOnWrite="true">
> >> > >>>         <indexedAttributes>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
> >> > >>>               cacheSize="10"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
> >> > >>>               cacheSize="10"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
> >> > >>>               cacheSize="10"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="ou"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="uid"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="objectClass"
> >> > >>>               cacheSize="100"/>
> >> > >>>         </indexedAttributes>
> >> > >>>         <contextEntry>
> >> > >>>           <value
> >> xmlns="http://www.springframework.org/schema/
> >> > >>> beans">
> >> > >>>             objectClass: top
> >> > >>>             objectClass: organizationalUnit
> >> > >>>             objectClass: extensibleObject
> >> > >>>             ou: system
> >> > >>>           </value>
> >> > >>>         </contextEntry>
> >> > >>>       </mutableBTreePartitionConfiguration>
> >> > >>>     </systemPartitionConfiguration>
> >> > >>>
> >> > >>>     <partitionConfigurations>
> >> > >>>       <mutableBTreePartitionConfiguration
> >> > >>> id="examplePartitionConfiguration"
> >> > >>>         name="example"
> >> > >>>         cacheSize="100"
> >> > >>>         suffix="dc=example,dc=com"
> >> > >>>         optimizerEnabled="true"
> >> > >>>         synchOnWrite="true">
> >> > >>>         <indexedAttributes>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
> >> > >>>               cacheSize="10"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
> >> > >>>               cacheSize="10"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
> >> > >>>               cacheSize="10"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="dc"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="ou"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="krb5PrincipalName"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="uid"
> >> > >>>               cacheSize="100"/>
> >> > >>>             <mutableIndexConfiguration
> >> > >>>               attributeId="objectClass"
> >> > >>>               cacheSize="100"/>
> >> > >>>         </indexedAttributes>
> >> > >>>         <contextEntry>
> >> > >>>           <value
> >> xmlns="http://www.springframework.org/schema/
> >> > >>> beans">
> >> > >>>             objectClass: top
> >> > >>>             objectClass: domain
> >> > >>>             objectClass: extensibleObject
> >> > >>>             dc: example
> >> > >>>           </value>
> >> > >>>         </contextEntry>
> >> > >>>       </mutableBTreePartitionConfiguration>
> >> > >>>     </partitionConfigurations>
> >> > >>>
> >> > >>>     <interceptorConfigurations>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="normalizationService">
> >> > >>>         <interceptor>
> >> > >>>           <normalizationService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="authenticationService">
> >> > >>>         <interceptor>
> >> > >>>           <authenticationService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="referralService">
> >> > >>>         <interceptor>
> >> > >>>           <referralService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="authorizationService">
> >> > >>>         <interceptor>
> >> > >>>           <authorizationService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="defaultAuthorizationService">
> >> > >>>         <interceptor>
> >> > >>>           <defaultAuthorizationService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="exceptionService">
> >> > >>>         <interceptor>
> >> > >>>           <exceptionService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="operationalAttributeService">
> >> > >>>         <interceptor>
> >> > >>>           <operationalAttributeService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="schemaService">
> >> > >>>         <interceptor>
> >> > >>>           <schemaService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="subentryService">
> >> > >>>         <interceptor>
> >> > >>>           <subentryService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="collectiveAttributeService">
> >> > >>>         <interceptor>
> >> > >>>           <collectiveAttributeService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="eventService">
> >> > >>>         <interceptor>
> >> > >>>           <eventService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>       <mutableInterceptorConfiguration
> >> > >>>               name="triggerService">
> >> > >>>         <interceptor>
> >> > >>>           <triggerService/>
> >> > >>>         </interceptor>
> >> > >>>       </mutableInterceptorConfiguration>
> >> > >>>
> >> > >>>     </interceptorConfigurations>
> >> > >>>   </mutableServerStartupConfiguration>
> >> > >>>
> >> > >>>
> >> > >>> <!-- another bean I didn't convert -->
> >> > >>>   <bean
> >> > >>>
> >> class="org.springframework.beans.factory.config.CustomEditorConfigur
> >> > >>> er">
> >> > >>>     <property name="customEditors">
> >> > >>>       <map>
> >> > >>>         <entry
> >> key="javax.naming.directory.Attributes">
> >> > >>>           <bean
> >> > >>>
> >> class="org.apache.directory.server.core.configuration.AttributesProp
> >> > >>> ertyEditor"/>
> >> > >>>         </entry>
> >> > >>>       </map>
> >> > >>>     </property>
> >> > >>>   </bean>
> >> > >>> </beans>
> >> > >>>
> >> > >>>
> >> > >>> Comments?
> >> > >>>
> >> > >>> thanks
> >> > >>> david jencks
> >> > >>>
> >> > >>>
> >> > >>
> >> > >>
> >> > >
> >> >
> >> >
> >>
> >>
> >
> >
>


-- 
Ersin Er

R.A. and Ph.D Student at the Dept. of Computer Eng. in Hacettepe University
http://www.cs.hacettepe.edu.tr

Committer and PMC Member of The Apache Directory Project
http://directory.apache.org

Re: Simplified server configuration with xbean-spring

Posted by Ole Ersoy <ol...@gmail.com>.
OK - I'll just throw one more idea into the mix.

Model the configuration file using xml schema.  Generate an EMF Model for it (This way serialized model instances conform to the schema keeping the semantic meaning intact).  Set the configuration defaults on the EMF Model.  Use the LDAP DAS to store the default entries in ApacheDS.  Now when ADS starts, it reads the configuration entries via the LDAP DAS and loads the corresponding EMF Model.  LS would also read the configuration file via the LDAP DAS and display it to the user for updates.  Then LS can save it to it's xml representation, reload it (Later if needed), and be the client for handling server updates.  Thoughts?

Cheers,
- Ole


Emmanuel Lecharny wrote:
> Hi guys,
> 
> sorry for the "deafening silence" ... We were quite busy those last
> days, up to a point we let this important mail dying silently ...
> 
> ok, I agree with David that the current server.xml is, to say the
> least, not very easy to handle, as it does not carry a lot of
> semantic.
> 
> Now, from our users perspective, we have two problems :
> 1) current users don't manipulate a lot this file, as you don't fix
> something which work, as soon as it's complicated to male it work
> again, due to the complexity of the current configuration file ( kind
> of circular situation ... )
> 2) new users are simply afraid to touch this configuration file,
> because it's too complex...
> 
> We have two ideas to help solving those problems :
> 1) Apache Directory Studio contains a GUI which helps to manupulate
> this file. Not sure that users are aware of that ...
> 2) we really want to move almost all of this configuration into the
> DIT in the next few months, so that we will be able to avoid having
> such a massive configuration file
> 
> The second solution will obviously be coupled with a new version of
> the first one.
> 
> I would add that there is no good solution to such a problem. We went
> from property file to spring configuration because the property file
> was ugly and didn't carried enough semantic. Now it's the same problem
> again. Pushing all the configuration into the DIT won't add extra
> semantic... This is a dead end. Wat I would suggest in this case is
> the least we change the configuration, the more likely users will get
> used with it. And I pretty much favor a move to the DIT for the sake
> of completeness : using LDAP to manage itself.
> 
> Let's face the reality : whatever level of semantic you add to a
> configuration file, you will _always_ need a good doco and nothing
> will replace the RTFM credo...
> 
> My 2cts...
> 
> On 7/3/07, Chris Custine <cc...@apache.org> wrote:
>> I could swear I replied to this the night you sent it but obviously I 
>> didn't
>>  :-)
>>
>> +1 (caveat below)
>>
>> I love xbean spring config files because I use ActiveMQ and ServiceMix 
>> quite
>> a bit and it really does help with some of the verbosity of the spring
>> files.  I think the lack of replies was because we have had several
>> discussions about removing the Spring config file and storing the 
>> config in
>> the DIT which would render this discussion irrelevant.
>>
>> While we were in Amsterdam I played with the idea of a LDAP Spring 
>> context
>> schema that loaded from LDAP and I have also seen some people refer to
>> loading the context as an xml string from a single LDAP entry.  These are
>> all viable options as well.
>>
>> In the mean time, I am all for using xbean to get some more mileage 
>> out of
>> the current state of things and maybe this will actually alleviate 
>> some of
>> the complaints about server.xml and I think we should do it sooner rather
>> than later.
>>
>> Chris
>>
>>
>> On 7/2/07, David Jencks <da...@yahoo.com> wrote:
>> >
>> > On Jul 2, 2007, at 8:32 PM, Aron Sogor wrote:
>> >
>> > > I am no Spring expert but how would it work for 3rd party 
>> integration.
>> > > When I want to insert my own "private" Mutable****Configuration?
>> > > How would I register those classes...
>> > > It would seem to make more difficult.
>> >
>> > With xbean-spring you can still use standard spring configuration: I
>> > left 2 beans unconverted in the server.xml below to show this. In
>> > fact the original server.xml still works as well, I converted it a
>> > bean at a time and ran everything I could figure out to make sure it
>> > stayed working.  You can also "annotate" your source code and run the
>> > maven plugin on them to generate a schema (in a different namespace)
>> > and use that to configure your bean with xbean-spring.  I don't this
>> > as being more difficult, but as supplying more options.
>> >
>> > thanks
>> > david jencks
>> >
>> > >
>> > > Aron
>> > > David Jencks wrote:
>> > >> So does the deafening silence that greeted this mean everyone is
>> > >> so awed by this that they are left speechless? :-)
>> > >>
>> > >> Seriously, does anyone have any comments on this?  Does everyone
>> > >> prefer the untyped spring style?
>> > >>
>> > >> On a related note, I've seen a lot of Mutable****Configuration
>> > >> classes in various spots and AFAICT their only purpose is to
>> > >> support springs troubles with constructor dependency injection.  I
>> > >> think there's a way to use xbean-spring to make the xml style as
>> > >> below fit into constructor dependency injection.  Any interest in
>> > >> this, or does everyone prefer what's happening now?
>> > >>
>> > >> thanks
>> > >> david jencks
>> > >>
>> > >>
>> > >> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
>> > >>
>> > >>> A while back there was some discussion of whether server.xml
>> > >>> could be made to be more semantically meaningful with less
>> > >>> generic cruft, and I suggested looking into xbean-spring.  So, I
>> > >>> spent a bit of time on it and implemented this.  See https://
>> > >>> issues.apache.org/jira/browse/DIRSERVER-984
>> > >>>
>> > >>> This was pretty easy to do, after fixing some problems in xbean.
>> > >>> Basically all I did was add some javadoc "annotations" to tell
>> > >>> xbean which classes to look at and what type collections contain,
>> > >>> and change to the xbean application context from the plain spring
>> > >>> one.
>> > >>>
>> > >>> xbean generates a schema for the configurable objects so you can
>> > >>> consult the schema to see what can be configured.  As you can
>> > >>> see, you can mix regular spring configuration and the xbean style
>> > >>> in the same server.xml.
>> > >>>
>> > >>> There's a lot more customization possible, I basically did the
>> > >>> minimum possible to get  it to work.  Pretty much anything can
>> > >>> have a different name.  The main ugliness I see is the handling
>> > >>> of properties that are lists (or sets) of strings.
>> > >>>
>> > >>> So, at the risk of posting too large a message,  here's the shiny
>> > >>> new server.xml (I removed some commented out bits) :
>> > >>>
>> > >>> <?xml version="1.0" encoding="UTF-8"?>
>> > >>>
>> > >>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>> > >>>
>> "http://www.springframework.org/dtd/spring-beans.dtd">
>> > >>>
>> > >>> <beans>
>> > >>> <!-- bean I didn't convert -->
>> > >>>   <bean id="environment"
>> > >>>
>> class="org.springframework.beans.factory.config.PropertiesFactoryBea
>> > >>> n">
>> > >>>     <property name="properties">
>> > >>>       <props>
>> > >>>         <!-- JNDI security properties used to get initial
>> > >>> contexts.         -->
>> > >>>         <prop
>> key="java.naming.security.authentication ">simple</
>> > >>> prop>
>> > >>>         <prop
>> > >>> key="java.naming.security.principal">uid=admin,ou=system</prop>
>> > >>>         <prop key="
>> java.naming.security.credentials">secret</prop>
>> > >>>       </props>
>> > >>>     </property>
>> > >>>   </bean>
>> > >>>
>> > >>>
>> > >>>   <mutableServerStartupConfiguration
>> id="configuration"
>> > >>> xmlns="http://apacheds.org/config/1.0"
>> > >>>
>> workingDirectory="example.com "
>> > >>>
>> synchPeriodMillis="5000"
>> > >>>                                      maxThreads="8"
>> > >>>
>> allowAnonymousAccess="false"
>> > >>>
>> accessControlEnabled="false"
>> > >>>
>> > >>> denormalizeOpAttrsEnabled="false"
>> > >>>           >
>> > >>>     <ntpConfiguration>
>> > >>>       <ntpConfiguration
>> > >>>               enabled="false"
>> > >>>               ipPort="123">
>> > >>>       </ntpConfiguration>
>> > >>>     </ntpConfiguration>
>> > >>>
>> > >>>     <dnsConfiguration>
>> > >>>       <dnsConfiguration
>> > >>>               enabled="false"
>> > >>>               ipPort="53">
>> > >>>       </dnsConfiguration>
>> > >>>     </dnsConfiguration>
>> > >>>
>> > >>>     <changePasswordConfiguration>
>> > >>>       <changePasswordConfiguration
>> > >>>               enabled="false"
>> > >>>               ipPort="464">
>> > >>>       </changePasswordConfiguration>
>> > >>>     </changePasswordConfiguration>
>> > >>>
>> > >>>     <kdcConfiguration>
>> > >>>       <kdcConfiguration
>> > >>>               enabled="false"
>> > >>>               ipPort="88">
>> > >>>       </kdcConfiguration>
>> > >>>     </kdcConfiguration>
>> > >>>
>> > >>>     <ldapConfiguration>
>> > >>>       <ldapConfiguration id="ldapConfiguration"
>> > >>>               ipPort="10389"
>> > >>>               allowAnonymousAccess="false"
>> > >>>               saslHost="ldap.example.com"
>> > >>>
>> saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM "
>> > >>>               searchBaseDn="ou=users,ou=system"
>> > >>>               maxTimeLimit="15000"
>> > >>>               maxSizeLimit="1000">
>> > >>>
>> > >>>         <!-- The list of supported authentication
>> > >>> mechanisms.                   -->
>> > >>>         <supportedMechanisms>
>> > >>>           <value xmlns="
>> http://www.springframework.org/schema/
>> > >>> beans">SIMPLE</value>
>> > >>>           <value xmlns="
>> http://www.springframework.org/schema/
>> > >>> beans">CRAM-MD5</value>
>> > >>>           <value
>> xmlns="http://www.springframework.org/schema/
>> > >>> beans">DIGEST-MD5</value>
>> > >>>           <!--<value
>> xmlns="http://www.springframework.org/schema/
>> > >>> beans">GSSAPI</value>-->
>> > >>>         </supportedMechanisms>
>> > >>>
>> > >>>         <!-- The desired quality-of-protection, used by DIGEST-
>> > >>> MD5 and GSSAPI.  -->
>> > >>>         <saslQop>
>> > >>>           <value
>> xmlns="http://www.springframework.org/schema/
>> > >>> beans">auth</value>
>> > >>>           <value xmlns="
>> http://www.springframework.org/schema/
>> > >>> beans">auth-int</value>
>> > >>>           <value xmlns="
>> http://www.springframework.org/schema/
>> > >>> beans">auth-conf</value>
>> > >>>         </saslQop>
>> > >>>
>> > >>>         <!-- The realms serviced by this SASL host, used by
>> > >>> DIGEST-MD5 and GSSAPI. -->
>> > >>>         <saslRealms>
>> > >>>           <value
>> xmlns="http://www.springframework.org/schema/
>> > >>> beans">example.com</value>
>> > >>>           <value
>> xmlns="http://www.springframework.org/schema/
>> > >>> beans">apache.org</value>
>> > >>>         </saslRealms>
>> > >>>
>> > >>>         <!-- the collection of extended operation handlers to
>> > >>> install           -->
>> > >>>         <extendedOperationHandlers>
>> > >>>           <gracefulShutdownHandler/>
>> > >>>           <launchDiagnosticUiHandler/>
>> > >>>         </extendedOperationHandlers>
>> > >>>       </ldapConfiguration>
>> > >>>     </ldapConfiguration>
>> > >>>
>> > >>>     <ldapsConfiguration>
>> > >>>       <ldapConfiguration id="ldapsConfiguration"
>> > >>>                          enabled="false"
>> > >>>                          ipPort="636"
>> > >>>                          enableLdaps="true">
>> > >>>       </ldapConfiguration>
>> > >>>     </ldapsConfiguration>
>> > >>>
>> > >>>     <systemPartitionConfiguration>
>> > >>>       <!-- use the following partitionConfiguration to override
>> > >>> defaults for  -->
>> > >>>       <!-- the system
>> > >>> partition
>>   -->
>> > >>>       <mutableBTreePartitionConfiguration
>> > >>> id="systemPartitionConfiguration"
>> > >>>         name="system"
>> > >>>         cacheSize="100"
>> > >>>         suffix="ou=system"
>> > >>>         optimizerEnabled="true"
>> > >>>         synchOnWrite="true">
>> > >>>         <indexedAttributes>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
>> > >>>               cacheSize="10"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>> > >>>               cacheSize="10"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>> > >>>               cacheSize="10"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="ou"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="uid"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="objectClass"
>> > >>>               cacheSize="100"/>
>> > >>>         </indexedAttributes>
>> > >>>         <contextEntry>
>> > >>>           <value
>> xmlns="http://www.springframework.org/schema/
>> > >>> beans">
>> > >>>             objectClass: top
>> > >>>             objectClass: organizationalUnit
>> > >>>             objectClass: extensibleObject
>> > >>>             ou: system
>> > >>>           </value>
>> > >>>         </contextEntry>
>> > >>>       </mutableBTreePartitionConfiguration>
>> > >>>     </systemPartitionConfiguration>
>> > >>>
>> > >>>     <partitionConfigurations>
>> > >>>       <mutableBTreePartitionConfiguration
>> > >>> id="examplePartitionConfiguration"
>> > >>>         name="example"
>> > >>>         cacheSize="100"
>> > >>>         suffix="dc=example,dc=com"
>> > >>>         optimizerEnabled="true"
>> > >>>         synchOnWrite="true">
>> > >>>         <indexedAttributes>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
>> > >>>               cacheSize="10"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>> > >>>               cacheSize="10"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>> > >>>               cacheSize="10"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="dc"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="ou"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="krb5PrincipalName"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="uid"
>> > >>>               cacheSize="100"/>
>> > >>>             <mutableIndexConfiguration
>> > >>>               attributeId="objectClass"
>> > >>>               cacheSize="100"/>
>> > >>>         </indexedAttributes>
>> > >>>         <contextEntry>
>> > >>>           <value
>> xmlns="http://www.springframework.org/schema/
>> > >>> beans">
>> > >>>             objectClass: top
>> > >>>             objectClass: domain
>> > >>>             objectClass: extensibleObject
>> > >>>             dc: example
>> > >>>           </value>
>> > >>>         </contextEntry>
>> > >>>       </mutableBTreePartitionConfiguration>
>> > >>>     </partitionConfigurations>
>> > >>>
>> > >>>     <interceptorConfigurations>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="normalizationService">
>> > >>>         <interceptor>
>> > >>>           <normalizationService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="authenticationService">
>> > >>>         <interceptor>
>> > >>>           <authenticationService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="referralService">
>> > >>>         <interceptor>
>> > >>>           <referralService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="authorizationService">
>> > >>>         <interceptor>
>> > >>>           <authorizationService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="defaultAuthorizationService">
>> > >>>         <interceptor>
>> > >>>           <defaultAuthorizationService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="exceptionService">
>> > >>>         <interceptor>
>> > >>>           <exceptionService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="operationalAttributeService">
>> > >>>         <interceptor>
>> > >>>           <operationalAttributeService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="schemaService">
>> > >>>         <interceptor>
>> > >>>           <schemaService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="subentryService">
>> > >>>         <interceptor>
>> > >>>           <subentryService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="collectiveAttributeService">
>> > >>>         <interceptor>
>> > >>>           <collectiveAttributeService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="eventService">
>> > >>>         <interceptor>
>> > >>>           <eventService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>       <mutableInterceptorConfiguration
>> > >>>               name="triggerService">
>> > >>>         <interceptor>
>> > >>>           <triggerService/>
>> > >>>         </interceptor>
>> > >>>       </mutableInterceptorConfiguration>
>> > >>>
>> > >>>     </interceptorConfigurations>
>> > >>>   </mutableServerStartupConfiguration>
>> > >>>
>> > >>>
>> > >>> <!-- another bean I didn't convert -->
>> > >>>   <bean
>> > >>>
>> class="org.springframework.beans.factory.config.CustomEditorConfigur
>> > >>> er">
>> > >>>     <property name="customEditors">
>> > >>>       <map>
>> > >>>         <entry
>> key="javax.naming.directory.Attributes">
>> > >>>           <bean
>> > >>>
>> class="org.apache.directory.server.core.configuration.AttributesProp
>> > >>> ertyEditor"/>
>> > >>>         </entry>
>> > >>>       </map>
>> > >>>     </property>
>> > >>>   </bean>
>> > >>> </beans>
>> > >>>
>> > >>>
>> > >>> Comments?
>> > >>>
>> > >>> thanks
>> > >>> david jencks
>> > >>>
>> > >>>
>> > >>
>> > >>
>> > >
>> >
>> >
>>
>>
> 
> 

Re: Simplified server configuration with xbean-spring

Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi guys,

sorry for the "deafening silence" ... We were quite busy those last
days, up to a point we let this important mail dying silently ...

ok, I agree with David that the current server.xml is, to say the
least, not very easy to handle, as it does not carry a lot of
semantic.

Now, from our users perspective, we have two problems :
1) current users don't manipulate a lot this file, as you don't fix
something which work, as soon as it's complicated to male it work
again, due to the complexity of the current configuration file ( kind
of circular situation ... )
2) new users are simply afraid to touch this configuration file,
because it's too complex...

We have two ideas to help solving those problems :
1) Apache Directory Studio contains a GUI which helps to manupulate
this file. Not sure that users are aware of that ...
2) we really want to move almost all of this configuration into the
DIT in the next few months, so that we will be able to avoid having
such a massive configuration file

The second solution will obviously be coupled with a new version of
the first one.

I would add that there is no good solution to such a problem. We went
from property file to spring configuration because the property file
was ugly and didn't carried enough semantic. Now it's the same problem
again. Pushing all the configuration into the DIT won't add extra
semantic... This is a dead end. Wat I would suggest in this case is
the least we change the configuration, the more likely users will get
used with it. And I pretty much favor a move to the DIT for the sake
of completeness : using LDAP to manage itself.

Let's face the reality : whatever level of semantic you add to a
configuration file, you will _always_ need a good doco and nothing
will replace the RTFM credo...

My 2cts...

On 7/3/07, Chris Custine <cc...@apache.org> wrote:
> I could swear I replied to this the night you sent it but obviously I didn't
>  :-)
>
> +1 (caveat below)
>
> I love xbean spring config files because I use ActiveMQ and ServiceMix quite
> a bit and it really does help with some of the verbosity of the spring
> files.  I think the lack of replies was because we have had several
> discussions about removing the Spring config file and storing the config in
> the DIT which would render this discussion irrelevant.
>
> While we were in Amsterdam I played with the idea of a LDAP Spring context
> schema that loaded from LDAP and I have also seen some people refer to
> loading the context as an xml string from a single LDAP entry.  These are
> all viable options as well.
>
> In the mean time, I am all for using xbean to get some more mileage out of
> the current state of things and maybe this will actually alleviate some of
> the complaints about server.xml and I think we should do it sooner rather
> than later.
>
> Chris
>
>
> On 7/2/07, David Jencks <da...@yahoo.com> wrote:
> >
> > On Jul 2, 2007, at 8:32 PM, Aron Sogor wrote:
> >
> > > I am no Spring expert but how would it work for 3rd party integration.
> > > When I want to insert my own "private" Mutable****Configuration?
> > > How would I register those classes...
> > > It would seem to make more difficult.
> >
> > With xbean-spring you can still use standard spring configuration: I
> > left 2 beans unconverted in the server.xml below to show this. In
> > fact the original server.xml still works as well, I converted it a
> > bean at a time and ran everything I could figure out to make sure it
> > stayed working.  You can also "annotate" your source code and run the
> > maven plugin on them to generate a schema (in a different namespace)
> > and use that to configure your bean with xbean-spring.  I don't this
> > as being more difficult, but as supplying more options.
> >
> > thanks
> > david jencks
> >
> > >
> > > Aron
> > > David Jencks wrote:
> > >> So does the deafening silence that greeted this mean everyone is
> > >> so awed by this that they are left speechless? :-)
> > >>
> > >> Seriously, does anyone have any comments on this?  Does everyone
> > >> prefer the untyped spring style?
> > >>
> > >> On a related note, I've seen a lot of Mutable****Configuration
> > >> classes in various spots and AFAICT their only purpose is to
> > >> support springs troubles with constructor dependency injection.  I
> > >> think there's a way to use xbean-spring to make the xml style as
> > >> below fit into constructor dependency injection.  Any interest in
> > >> this, or does everyone prefer what's happening now?
> > >>
> > >> thanks
> > >> david jencks
> > >>
> > >>
> > >> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
> > >>
> > >>> A while back there was some discussion of whether server.xml
> > >>> could be made to be more semantically meaningful with less
> > >>> generic cruft, and I suggested looking into xbean-spring.  So, I
> > >>> spent a bit of time on it and implemented this.  See https://
> > >>> issues.apache.org/jira/browse/DIRSERVER-984
> > >>>
> > >>> This was pretty easy to do, after fixing some problems in xbean.
> > >>> Basically all I did was add some javadoc "annotations" to tell
> > >>> xbean which classes to look at and what type collections contain,
> > >>> and change to the xbean application context from the plain spring
> > >>> one.
> > >>>
> > >>> xbean generates a schema for the configurable objects so you can
> > >>> consult the schema to see what can be configured.  As you can
> > >>> see, you can mix regular spring configuration and the xbean style
> > >>> in the same server.xml.
> > >>>
> > >>> There's a lot more customization possible, I basically did the
> > >>> minimum possible to get  it to work.  Pretty much anything can
> > >>> have a different name.  The main ugliness I see is the handling
> > >>> of properties that are lists (or sets) of strings.
> > >>>
> > >>> So, at the risk of posting too large a message,  here's the shiny
> > >>> new server.xml (I removed some commented out bits) :
> > >>>
> > >>> <?xml version="1.0" encoding="UTF-8"?>
> > >>>
> > >>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> > >>>
> "http://www.springframework.org/dtd/spring-beans.dtd">
> > >>>
> > >>> <beans>
> > >>> <!-- bean I didn't convert -->
> > >>>   <bean id="environment"
> > >>>
> class="org.springframework.beans.factory.config.PropertiesFactoryBea
> > >>> n">
> > >>>     <property name="properties">
> > >>>       <props>
> > >>>         <!-- JNDI security properties used to get initial
> > >>> contexts.         -->
> > >>>         <prop
> key="java.naming.security.authentication ">simple</
> > >>> prop>
> > >>>         <prop
> > >>> key="java.naming.security.principal">uid=admin,ou=system</prop>
> > >>>         <prop key="
> java.naming.security.credentials">secret</prop>
> > >>>       </props>
> > >>>     </property>
> > >>>   </bean>
> > >>>
> > >>>
> > >>>   <mutableServerStartupConfiguration
> id="configuration"
> > >>> xmlns="http://apacheds.org/config/1.0"
> > >>>
> workingDirectory="example.com "
> > >>>
> synchPeriodMillis="5000"
> > >>>                                      maxThreads="8"
> > >>>
> allowAnonymousAccess="false"
> > >>>
> accessControlEnabled="false"
> > >>>
> > >>> denormalizeOpAttrsEnabled="false"
> > >>>           >
> > >>>     <ntpConfiguration>
> > >>>       <ntpConfiguration
> > >>>               enabled="false"
> > >>>               ipPort="123">
> > >>>       </ntpConfiguration>
> > >>>     </ntpConfiguration>
> > >>>
> > >>>     <dnsConfiguration>
> > >>>       <dnsConfiguration
> > >>>               enabled="false"
> > >>>               ipPort="53">
> > >>>       </dnsConfiguration>
> > >>>     </dnsConfiguration>
> > >>>
> > >>>     <changePasswordConfiguration>
> > >>>       <changePasswordConfiguration
> > >>>               enabled="false"
> > >>>               ipPort="464">
> > >>>       </changePasswordConfiguration>
> > >>>     </changePasswordConfiguration>
> > >>>
> > >>>     <kdcConfiguration>
> > >>>       <kdcConfiguration
> > >>>               enabled="false"
> > >>>               ipPort="88">
> > >>>       </kdcConfiguration>
> > >>>     </kdcConfiguration>
> > >>>
> > >>>     <ldapConfiguration>
> > >>>       <ldapConfiguration id="ldapConfiguration"
> > >>>               ipPort="10389"
> > >>>               allowAnonymousAccess="false"
> > >>>               saslHost="ldap.example.com"
> > >>>
> saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM "
> > >>>               searchBaseDn="ou=users,ou=system"
> > >>>               maxTimeLimit="15000"
> > >>>               maxSizeLimit="1000">
> > >>>
> > >>>         <!-- The list of supported authentication
> > >>> mechanisms.                   -->
> > >>>         <supportedMechanisms>
> > >>>           <value xmlns="
> http://www.springframework.org/schema/
> > >>> beans">SIMPLE</value>
> > >>>           <value xmlns="
> http://www.springframework.org/schema/
> > >>> beans">CRAM-MD5</value>
> > >>>           <value
> xmlns="http://www.springframework.org/schema/
> > >>> beans">DIGEST-MD5</value>
> > >>>           <!--<value
> xmlns="http://www.springframework.org/schema/
> > >>> beans">GSSAPI</value>-->
> > >>>         </supportedMechanisms>
> > >>>
> > >>>         <!-- The desired quality-of-protection, used by DIGEST-
> > >>> MD5 and GSSAPI.  -->
> > >>>         <saslQop>
> > >>>           <value
> xmlns="http://www.springframework.org/schema/
> > >>> beans">auth</value>
> > >>>           <value xmlns="
> http://www.springframework.org/schema/
> > >>> beans">auth-int</value>
> > >>>           <value xmlns="
> http://www.springframework.org/schema/
> > >>> beans">auth-conf</value>
> > >>>         </saslQop>
> > >>>
> > >>>         <!-- The realms serviced by this SASL host, used by
> > >>> DIGEST-MD5 and GSSAPI. -->
> > >>>         <saslRealms>
> > >>>           <value
> xmlns="http://www.springframework.org/schema/
> > >>> beans">example.com</value>
> > >>>           <value
> xmlns="http://www.springframework.org/schema/
> > >>> beans">apache.org</value>
> > >>>         </saslRealms>
> > >>>
> > >>>         <!-- the collection of extended operation handlers to
> > >>> install           -->
> > >>>         <extendedOperationHandlers>
> > >>>           <gracefulShutdownHandler/>
> > >>>           <launchDiagnosticUiHandler/>
> > >>>         </extendedOperationHandlers>
> > >>>       </ldapConfiguration>
> > >>>     </ldapConfiguration>
> > >>>
> > >>>     <ldapsConfiguration>
> > >>>       <ldapConfiguration id="ldapsConfiguration"
> > >>>                          enabled="false"
> > >>>                          ipPort="636"
> > >>>                          enableLdaps="true">
> > >>>       </ldapConfiguration>
> > >>>     </ldapsConfiguration>
> > >>>
> > >>>     <systemPartitionConfiguration>
> > >>>       <!-- use the following partitionConfiguration to override
> > >>> defaults for  -->
> > >>>       <!-- the system
> > >>> partition
>   -->
> > >>>       <mutableBTreePartitionConfiguration
> > >>> id="systemPartitionConfiguration"
> > >>>         name="system"
> > >>>         cacheSize="100"
> > >>>         suffix="ou=system"
> > >>>         optimizerEnabled="true"
> > >>>         synchOnWrite="true">
> > >>>         <indexedAttributes>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
> > >>>               cacheSize="10"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
> > >>>               cacheSize="10"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
> > >>>               cacheSize="10"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="ou"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="uid"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="objectClass"
> > >>>               cacheSize="100"/>
> > >>>         </indexedAttributes>
> > >>>         <contextEntry>
> > >>>           <value
> xmlns="http://www.springframework.org/schema/
> > >>> beans">
> > >>>             objectClass: top
> > >>>             objectClass: organizationalUnit
> > >>>             objectClass: extensibleObject
> > >>>             ou: system
> > >>>           </value>
> > >>>         </contextEntry>
> > >>>       </mutableBTreePartitionConfiguration>
> > >>>     </systemPartitionConfiguration>
> > >>>
> > >>>     <partitionConfigurations>
> > >>>       <mutableBTreePartitionConfiguration
> > >>> id="examplePartitionConfiguration"
> > >>>         name="example"
> > >>>         cacheSize="100"
> > >>>         suffix="dc=example,dc=com"
> > >>>         optimizerEnabled="true"
> > >>>         synchOnWrite="true">
> > >>>         <indexedAttributes>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId=" 1.3.6.1.4.1.18060.0.4.1.2.4"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5 "
> > >>>               cacheSize="10"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
> > >>>               cacheSize="10"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
> > >>>               cacheSize="10"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="dc"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="ou"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="krb5PrincipalName"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="uid"
> > >>>               cacheSize="100"/>
> > >>>             <mutableIndexConfiguration
> > >>>               attributeId="objectClass"
> > >>>               cacheSize="100"/>
> > >>>         </indexedAttributes>
> > >>>         <contextEntry>
> > >>>           <value
> xmlns="http://www.springframework.org/schema/
> > >>> beans">
> > >>>             objectClass: top
> > >>>             objectClass: domain
> > >>>             objectClass: extensibleObject
> > >>>             dc: example
> > >>>           </value>
> > >>>         </contextEntry>
> > >>>       </mutableBTreePartitionConfiguration>
> > >>>     </partitionConfigurations>
> > >>>
> > >>>     <interceptorConfigurations>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="normalizationService">
> > >>>         <interceptor>
> > >>>           <normalizationService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="authenticationService">
> > >>>         <interceptor>
> > >>>           <authenticationService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="referralService">
> > >>>         <interceptor>
> > >>>           <referralService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="authorizationService">
> > >>>         <interceptor>
> > >>>           <authorizationService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="defaultAuthorizationService">
> > >>>         <interceptor>
> > >>>           <defaultAuthorizationService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="exceptionService">
> > >>>         <interceptor>
> > >>>           <exceptionService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="operationalAttributeService">
> > >>>         <interceptor>
> > >>>           <operationalAttributeService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="schemaService">
> > >>>         <interceptor>
> > >>>           <schemaService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="subentryService">
> > >>>         <interceptor>
> > >>>           <subentryService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="collectiveAttributeService">
> > >>>         <interceptor>
> > >>>           <collectiveAttributeService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="eventService">
> > >>>         <interceptor>
> > >>>           <eventService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>       <mutableInterceptorConfiguration
> > >>>               name="triggerService">
> > >>>         <interceptor>
> > >>>           <triggerService/>
> > >>>         </interceptor>
> > >>>       </mutableInterceptorConfiguration>
> > >>>
> > >>>     </interceptorConfigurations>
> > >>>   </mutableServerStartupConfiguration>
> > >>>
> > >>>
> > >>> <!-- another bean I didn't convert -->
> > >>>   <bean
> > >>>
> class="org.springframework.beans.factory.config.CustomEditorConfigur
> > >>> er">
> > >>>     <property name="customEditors">
> > >>>       <map>
> > >>>         <entry
> key="javax.naming.directory.Attributes">
> > >>>           <bean
> > >>>
> class="org.apache.directory.server.core.configuration.AttributesProp
> > >>> ertyEditor"/>
> > >>>         </entry>
> > >>>       </map>
> > >>>     </property>
> > >>>   </bean>
> > >>> </beans>
> > >>>
> > >>>
> > >>> Comments?
> > >>>
> > >>> thanks
> > >>> david jencks
> > >>>
> > >>>
> > >>
> > >>
> > >
> >
> >
>
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: Simplified server configuration with xbean-spring

Posted by Chris Custine <cc...@apache.org>.
I could swear I replied to this the night you sent it but obviously I
didn't  :-)

+1 (caveat below)

I love xbean spring config files because I use ActiveMQ and ServiceMix quite
a bit and it really does help with some of the verbosity of the spring
files.  I think the lack of replies was because we have had several
discussions about removing the Spring config file and storing the config in
the DIT which would render this discussion irrelevant.

While we were in Amsterdam I played with the idea of a LDAP Spring context
schema that loaded from LDAP and I have also seen some people refer to
loading the context as an xml string from a single LDAP entry.  These are
all viable options as well.

In the mean time, I am all for using xbean to get some more mileage out of
the current state of things and maybe this will actually alleviate some of
the complaints about server.xml and I think we should do it sooner rather
than later.

Chris

On 7/2/07, David Jencks <da...@yahoo.com> wrote:
>
>
> On Jul 2, 2007, at 8:32 PM, Aron Sogor wrote:
>
> > I am no Spring expert but how would it work for 3rd party integration.
> > When I want to insert my own "private" Mutable****Configuration?
> > How would I register those classes...
> > It would seem to make more difficult.
>
> With xbean-spring you can still use standard spring configuration: I
> left 2 beans unconverted in the server.xml below to show this. In
> fact the original server.xml still works as well, I converted it a
> bean at a time and ran everything I could figure out to make sure it
> stayed working.  You can also "annotate" your source code and run the
> maven plugin on them to generate a schema (in a different namespace)
> and use that to configure your bean with xbean-spring.  I don't this
> as being more difficult, but as supplying more options.
>
> thanks
> david jencks
>
> >
> > Aron
> > David Jencks wrote:
> >> So does the deafening silence that greeted this mean everyone is
> >> so awed by this that they are left speechless? :-)
> >>
> >> Seriously, does anyone have any comments on this?  Does everyone
> >> prefer the untyped spring style?
> >>
> >> On a related note, I've seen a lot of Mutable****Configuration
> >> classes in various spots and AFAICT their only purpose is to
> >> support springs troubles with constructor dependency injection.  I
> >> think there's a way to use xbean-spring to make the xml style as
> >> below fit into constructor dependency injection.  Any interest in
> >> this, or does everyone prefer what's happening now?
> >>
> >> thanks
> >> david jencks
> >>
> >>
> >> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
> >>
> >>> A while back there was some discussion of whether server.xml
> >>> could be made to be more semantically meaningful with less
> >>> generic cruft, and I suggested looking into xbean-spring.  So, I
> >>> spent a bit of time on it and implemented this.  See https://
> >>> issues.apache.org/jira/browse/DIRSERVER-984
> >>>
> >>> This was pretty easy to do, after fixing some problems in xbean.
> >>> Basically all I did was add some javadoc "annotations" to tell
> >>> xbean which classes to look at and what type collections contain,
> >>> and change to the xbean application context from the plain spring
> >>> one.
> >>>
> >>> xbean generates a schema for the configurable objects so you can
> >>> consult the schema to see what can be configured.  As you can
> >>> see, you can mix regular spring configuration and the xbean style
> >>> in the same server.xml.
> >>>
> >>> There's a lot more customization possible, I basically did the
> >>> minimum possible to get  it to work.  Pretty much anything can
> >>> have a different name.  The main ugliness I see is the handling
> >>> of properties that are lists (or sets) of strings.
> >>>
> >>> So, at the risk of posting too large a message,  here's the shiny
> >>> new server.xml (I removed some commented out bits) :
> >>>
> >>> <?xml version="1.0" encoding="UTF-8"?>
> >>>
> >>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
> >>>         "http://www.springframework.org/dtd/spring-beans.dtd">
> >>>
> >>> <beans>
> >>> <!-- bean I didn't convert -->
> >>>   <bean id="environment"
> >>> class="org.springframework.beans.factory.config.PropertiesFactoryBea
> >>> n">
> >>>     <property name="properties">
> >>>       <props>
> >>>         <!-- JNDI security properties used to get initial
> >>> contexts.         -->
> >>>         <prop key="java.naming.security.authentication">simple</
> >>> prop>
> >>>         <prop
> >>> key="java.naming.security.principal">uid=admin,ou=system</prop>
> >>>         <prop key="java.naming.security.credentials">secret</prop>
> >>>       </props>
> >>>     </property>
> >>>   </bean>
> >>>
> >>>
> >>>   <mutableServerStartupConfiguration id="configuration"
> >>> xmlns="http://apacheds.org/config/1.0"
> >>>                                      workingDirectory="example.com"
> >>>                                      synchPeriodMillis="5000"
> >>>                                      maxThreads="8"
> >>>                                      allowAnonymousAccess="false"
> >>>                                      accessControlEnabled="false"
> >>>
> >>> denormalizeOpAttrsEnabled="false"
> >>>           >
> >>>     <ntpConfiguration>
> >>>       <ntpConfiguration
> >>>               enabled="false"
> >>>               ipPort="123">
> >>>       </ntpConfiguration>
> >>>     </ntpConfiguration>
> >>>
> >>>     <dnsConfiguration>
> >>>       <dnsConfiguration
> >>>               enabled="false"
> >>>               ipPort="53">
> >>>       </dnsConfiguration>
> >>>     </dnsConfiguration>
> >>>
> >>>     <changePasswordConfiguration>
> >>>       <changePasswordConfiguration
> >>>               enabled="false"
> >>>               ipPort="464">
> >>>       </changePasswordConfiguration>
> >>>     </changePasswordConfiguration>
> >>>
> >>>     <kdcConfiguration>
> >>>       <kdcConfiguration
> >>>               enabled="false"
> >>>               ipPort="88">
> >>>       </kdcConfiguration>
> >>>     </kdcConfiguration>
> >>>
> >>>     <ldapConfiguration>
> >>>       <ldapConfiguration id="ldapConfiguration"
> >>>               ipPort="10389"
> >>>               allowAnonymousAccess="false"
> >>>               saslHost="ldap.example.com"
> >>>               saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM"
> >>>               searchBaseDn="ou=users,ou=system"
> >>>               maxTimeLimit="15000"
> >>>               maxSizeLimit="1000">
> >>>
> >>>         <!-- The list of supported authentication
> >>> mechanisms.                   -->
> >>>         <supportedMechanisms>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">SIMPLE</value>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">CRAM-MD5</value>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">DIGEST-MD5</value>
> >>>           <!--<value xmlns="http://www.springframework.org/schema/
> >>> beans">GSSAPI</value>-->
> >>>         </supportedMechanisms>
> >>>
> >>>         <!-- The desired quality-of-protection, used by DIGEST-
> >>> MD5 and GSSAPI.  -->
> >>>         <saslQop>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">auth</value>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">auth-int</value>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">auth-conf</value>
> >>>         </saslQop>
> >>>
> >>>         <!-- The realms serviced by this SASL host, used by
> >>> DIGEST-MD5 and GSSAPI. -->
> >>>         <saslRealms>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">example.com</value>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">apache.org</value>
> >>>         </saslRealms>
> >>>
> >>>         <!-- the collection of extended operation handlers to
> >>> install           -->
> >>>         <extendedOperationHandlers>
> >>>           <gracefulShutdownHandler/>
> >>>           <launchDiagnosticUiHandler/>
> >>>         </extendedOperationHandlers>
> >>>       </ldapConfiguration>
> >>>     </ldapConfiguration>
> >>>
> >>>     <ldapsConfiguration>
> >>>       <ldapConfiguration id="ldapsConfiguration"
> >>>                          enabled="false"
> >>>                          ipPort="636"
> >>>                          enableLdaps="true">
> >>>       </ldapConfiguration>
> >>>     </ldapsConfiguration>
> >>>
> >>>     <systemPartitionConfiguration>
> >>>       <!-- use the following partitionConfiguration to override
> >>> defaults for  -->
> >>>       <!-- the system
> >>> partition                                               -->
> >>>       <mutableBTreePartitionConfiguration
> >>> id="systemPartitionConfiguration"
> >>>         name="system"
> >>>         cacheSize="100"
> >>>         suffix="ou=system"
> >>>         optimizerEnabled="true"
> >>>         synchOnWrite="true">
> >>>         <indexedAttributes>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
> >>>               cacheSize="10"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
> >>>               cacheSize="10"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
> >>>               cacheSize="10"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="ou"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="uid"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="objectClass"
> >>>               cacheSize="100"/>
> >>>         </indexedAttributes>
> >>>         <contextEntry>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">
> >>>             objectClass: top
> >>>             objectClass: organizationalUnit
> >>>             objectClass: extensibleObject
> >>>             ou: system
> >>>           </value>
> >>>         </contextEntry>
> >>>       </mutableBTreePartitionConfiguration>
> >>>     </systemPartitionConfiguration>
> >>>
> >>>     <partitionConfigurations>
> >>>       <mutableBTreePartitionConfiguration
> >>> id="examplePartitionConfiguration"
> >>>         name="example"
> >>>         cacheSize="100"
> >>>         suffix="dc=example,dc=com"
> >>>         optimizerEnabled="true"
> >>>         synchOnWrite="true">
> >>>         <indexedAttributes>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
> >>>               cacheSize="10"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
> >>>               cacheSize="10"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
> >>>               cacheSize="10"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="dc"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="ou"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="krb5PrincipalName"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="uid"
> >>>               cacheSize="100"/>
> >>>             <mutableIndexConfiguration
> >>>               attributeId="objectClass"
> >>>               cacheSize="100"/>
> >>>         </indexedAttributes>
> >>>         <contextEntry>
> >>>           <value xmlns="http://www.springframework.org/schema/
> >>> beans">
> >>>             objectClass: top
> >>>             objectClass: domain
> >>>             objectClass: extensibleObject
> >>>             dc: example
> >>>           </value>
> >>>         </contextEntry>
> >>>       </mutableBTreePartitionConfiguration>
> >>>     </partitionConfigurations>
> >>>
> >>>     <interceptorConfigurations>
> >>>       <mutableInterceptorConfiguration
> >>>               name="normalizationService">
> >>>         <interceptor>
> >>>           <normalizationService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="authenticationService">
> >>>         <interceptor>
> >>>           <authenticationService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="referralService">
> >>>         <interceptor>
> >>>           <referralService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="authorizationService">
> >>>         <interceptor>
> >>>           <authorizationService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="defaultAuthorizationService">
> >>>         <interceptor>
> >>>           <defaultAuthorizationService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="exceptionService">
> >>>         <interceptor>
> >>>           <exceptionService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="operationalAttributeService">
> >>>         <interceptor>
> >>>           <operationalAttributeService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="schemaService">
> >>>         <interceptor>
> >>>           <schemaService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="subentryService">
> >>>         <interceptor>
> >>>           <subentryService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="collectiveAttributeService">
> >>>         <interceptor>
> >>>           <collectiveAttributeService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="eventService">
> >>>         <interceptor>
> >>>           <eventService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>       <mutableInterceptorConfiguration
> >>>               name="triggerService">
> >>>         <interceptor>
> >>>           <triggerService/>
> >>>         </interceptor>
> >>>       </mutableInterceptorConfiguration>
> >>>
> >>>     </interceptorConfigurations>
> >>>   </mutableServerStartupConfiguration>
> >>>
> >>>
> >>> <!-- another bean I didn't convert -->
> >>>   <bean
> >>> class="org.springframework.beans.factory.config.CustomEditorConfigur
> >>> er">
> >>>     <property name="customEditors">
> >>>       <map>
> >>>         <entry key="javax.naming.directory.Attributes">
> >>>           <bean
> >>> class="org.apache.directory.server.core.configuration.AttributesProp
> >>> ertyEditor"/>
> >>>         </entry>
> >>>       </map>
> >>>     </property>
> >>>   </bean>
> >>> </beans>
> >>>
> >>>
> >>> Comments?
> >>>
> >>> thanks
> >>> david jencks
> >>>
> >>>
> >>
> >>
> >
>
>

Re: Simplified server configuration with xbean-spring

Posted by David Jencks <da...@yahoo.com>.
On Jul 2, 2007, at 8:32 PM, Aron Sogor wrote:

> I am no Spring expert but how would it work for 3rd party integration.
> When I want to insert my own "private" Mutable****Configuration?
> How would I register those classes...
> It would seem to make more difficult.

With xbean-spring you can still use standard spring configuration: I  
left 2 beans unconverted in the server.xml below to show this. In  
fact the original server.xml still works as well, I converted it a  
bean at a time and ran everything I could figure out to make sure it  
stayed working.  You can also "annotate" your source code and run the  
maven plugin on them to generate a schema (in a different namespace)  
and use that to configure your bean with xbean-spring.  I don't this  
as being more difficult, but as supplying more options.

thanks
david jencks

>
> Aron
> David Jencks wrote:
>> So does the deafening silence that greeted this mean everyone is  
>> so awed by this that they are left speechless? :-)
>>
>> Seriously, does anyone have any comments on this?  Does everyone  
>> prefer the untyped spring style?
>>
>> On a related note, I've seen a lot of Mutable****Configuration  
>> classes in various spots and AFAICT their only purpose is to  
>> support springs troubles with constructor dependency injection.  I  
>> think there's a way to use xbean-spring to make the xml style as  
>> below fit into constructor dependency injection.  Any interest in  
>> this, or does everyone prefer what's happening now?
>>
>> thanks
>> david jencks
>>
>>
>> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
>>
>>> A while back there was some discussion of whether server.xml  
>>> could be made to be more semantically meaningful with less  
>>> generic cruft, and I suggested looking into xbean-spring.  So, I  
>>> spent a bit of time on it and implemented this.  See https:// 
>>> issues.apache.org/jira/browse/DIRSERVER-984
>>>
>>> This was pretty easy to do, after fixing some problems in xbean.   
>>> Basically all I did was add some javadoc "annotations" to tell  
>>> xbean which classes to look at and what type collections contain,  
>>> and change to the xbean application context from the plain spring  
>>> one.
>>>
>>> xbean generates a schema for the configurable objects so you can  
>>> consult the schema to see what can be configured.  As you can  
>>> see, you can mix regular spring configuration and the xbean style  
>>> in the same server.xml.
>>>
>>> There's a lot more customization possible, I basically did the  
>>> minimum possible to get  it to work.  Pretty much anything can  
>>> have a different name.  The main ugliness I see is the handling  
>>> of properties that are lists (or sets) of strings.
>>>
>>> So, at the risk of posting too large a message,  here's the shiny  
>>> new server.xml (I removed some commented out bits) :
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>>>         "http://www.springframework.org/dtd/spring-beans.dtd">
>>>
>>> <beans>
>>> <!-- bean I didn't convert -->
>>>   <bean id="environment"  
>>> class="org.springframework.beans.factory.config.PropertiesFactoryBea 
>>> n">
>>>     <property name="properties">
>>>       <props>
>>>         <!-- JNDI security properties used to get initial  
>>> contexts.         -->
>>>         <prop key="java.naming.security.authentication">simple</ 
>>> prop>
>>>         <prop  
>>> key="java.naming.security.principal">uid=admin,ou=system</prop>
>>>         <prop key="java.naming.security.credentials">secret</prop>
>>>       </props>
>>>     </property>
>>>   </bean>
>>>
>>>
>>>   <mutableServerStartupConfiguration id="configuration"  
>>> xmlns="http://apacheds.org/config/1.0"
>>>                                      workingDirectory="example.com"
>>>                                      synchPeriodMillis="5000"
>>>                                      maxThreads="8"
>>>                                      allowAnonymousAccess="false"
>>>                                      accessControlEnabled="false"
>>>                                       
>>> denormalizeOpAttrsEnabled="false"
>>>           >
>>>     <ntpConfiguration>
>>>       <ntpConfiguration
>>>               enabled="false"
>>>               ipPort="123">
>>>       </ntpConfiguration>
>>>     </ntpConfiguration>
>>>
>>>     <dnsConfiguration>
>>>       <dnsConfiguration
>>>               enabled="false"
>>>               ipPort="53">
>>>       </dnsConfiguration>
>>>     </dnsConfiguration>
>>>
>>>     <changePasswordConfiguration>
>>>       <changePasswordConfiguration
>>>               enabled="false"
>>>               ipPort="464">
>>>       </changePasswordConfiguration>
>>>     </changePasswordConfiguration>
>>>
>>>     <kdcConfiguration>
>>>       <kdcConfiguration
>>>               enabled="false"
>>>               ipPort="88">
>>>       </kdcConfiguration>
>>>     </kdcConfiguration>
>>>
>>>     <ldapConfiguration>
>>>       <ldapConfiguration id="ldapConfiguration"
>>>               ipPort="10389"
>>>               allowAnonymousAccess="false"
>>>               saslHost="ldap.example.com"
>>>               saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM"
>>>               searchBaseDn="ou=users,ou=system"
>>>               maxTimeLimit="15000"
>>>               maxSizeLimit="1000">
>>>
>>>         <!-- The list of supported authentication  
>>> mechanisms.                   -->
>>>         <supportedMechanisms>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">SIMPLE</value>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">CRAM-MD5</value>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">DIGEST-MD5</value>
>>>           <!--<value xmlns="http://www.springframework.org/schema/ 
>>> beans">GSSAPI</value>-->
>>>         </supportedMechanisms>
>>>
>>>         <!-- The desired quality-of-protection, used by DIGEST- 
>>> MD5 and GSSAPI.  -->
>>>         <saslQop>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">auth</value>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">auth-int</value>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">auth-conf</value>
>>>         </saslQop>
>>>
>>>         <!-- The realms serviced by this SASL host, used by  
>>> DIGEST-MD5 and GSSAPI. -->
>>>         <saslRealms>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">example.com</value>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">apache.org</value>
>>>         </saslRealms>
>>>
>>>         <!-- the collection of extended operation handlers to  
>>> install           -->
>>>         <extendedOperationHandlers>
>>>           <gracefulShutdownHandler/>
>>>           <launchDiagnosticUiHandler/>
>>>         </extendedOperationHandlers>
>>>       </ldapConfiguration>
>>>     </ldapConfiguration>
>>>
>>>     <ldapsConfiguration>
>>>       <ldapConfiguration id="ldapsConfiguration"
>>>                          enabled="false"
>>>                          ipPort="636"
>>>                          enableLdaps="true">
>>>       </ldapConfiguration>
>>>     </ldapsConfiguration>
>>>
>>>     <systemPartitionConfiguration>
>>>       <!-- use the following partitionConfiguration to override  
>>> defaults for  -->
>>>       <!-- the system  
>>> partition                                               -->
>>>       <mutableBTreePartitionConfiguration  
>>> id="systemPartitionConfiguration"
>>>         name="system"
>>>         cacheSize="100"
>>>         suffix="ou=system"
>>>         optimizerEnabled="true"
>>>         synchOnWrite="true">
>>>         <indexedAttributes>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
>>>               cacheSize="10"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>>>               cacheSize="10"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>>>               cacheSize="10"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="ou"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="uid"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="objectClass"
>>>               cacheSize="100"/>
>>>         </indexedAttributes>
>>>         <contextEntry>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">
>>>             objectClass: top
>>>             objectClass: organizationalUnit
>>>             objectClass: extensibleObject
>>>             ou: system
>>>           </value>
>>>         </contextEntry>
>>>       </mutableBTreePartitionConfiguration>
>>>     </systemPartitionConfiguration>
>>>
>>>     <partitionConfigurations>
>>>       <mutableBTreePartitionConfiguration  
>>> id="examplePartitionConfiguration"
>>>         name="example"
>>>         cacheSize="100"
>>>         suffix="dc=example,dc=com"
>>>         optimizerEnabled="true"
>>>         synchOnWrite="true">
>>>         <indexedAttributes>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
>>>               cacheSize="10"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>>>               cacheSize="10"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>>>               cacheSize="10"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="dc"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="ou"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="krb5PrincipalName"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="uid"
>>>               cacheSize="100"/>
>>>             <mutableIndexConfiguration
>>>               attributeId="objectClass"
>>>               cacheSize="100"/>
>>>         </indexedAttributes>
>>>         <contextEntry>
>>>           <value xmlns="http://www.springframework.org/schema/ 
>>> beans">
>>>             objectClass: top
>>>             objectClass: domain
>>>             objectClass: extensibleObject
>>>             dc: example
>>>           </value>
>>>         </contextEntry>
>>>       </mutableBTreePartitionConfiguration>
>>>     </partitionConfigurations>
>>>
>>>     <interceptorConfigurations>
>>>       <mutableInterceptorConfiguration
>>>               name="normalizationService">
>>>         <interceptor>
>>>           <normalizationService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="authenticationService">
>>>         <interceptor>
>>>           <authenticationService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="referralService">
>>>         <interceptor>
>>>           <referralService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="authorizationService">
>>>         <interceptor>
>>>           <authorizationService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="defaultAuthorizationService">
>>>         <interceptor>
>>>           <defaultAuthorizationService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="exceptionService">
>>>         <interceptor>
>>>           <exceptionService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="operationalAttributeService">
>>>         <interceptor>
>>>           <operationalAttributeService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="schemaService">
>>>         <interceptor>
>>>           <schemaService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="subentryService">
>>>         <interceptor>
>>>           <subentryService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="collectiveAttributeService">
>>>         <interceptor>
>>>           <collectiveAttributeService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="eventService">
>>>         <interceptor>
>>>           <eventService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>       <mutableInterceptorConfiguration
>>>               name="triggerService">
>>>         <interceptor>
>>>           <triggerService/>
>>>         </interceptor>
>>>       </mutableInterceptorConfiguration>
>>>
>>>     </interceptorConfigurations>
>>>   </mutableServerStartupConfiguration>
>>>
>>>
>>> <!-- another bean I didn't convert -->
>>>   <bean  
>>> class="org.springframework.beans.factory.config.CustomEditorConfigur 
>>> er">
>>>     <property name="customEditors">
>>>       <map>
>>>         <entry key="javax.naming.directory.Attributes">
>>>           <bean  
>>> class="org.apache.directory.server.core.configuration.AttributesProp 
>>> ertyEditor"/>
>>>         </entry>
>>>       </map>
>>>     </property>
>>>   </bean>
>>> </beans>
>>>
>>>
>>> Comments?
>>>
>>> thanks
>>> david jencks
>>>
>>>
>>
>>
>


Re: Simplified server configuration with xbean-spring

Posted by Aron Sogor <ar...@theatlantis.net>.
I am no Spring expert but how would it work for 3rd party integration.
When I want to insert my own "private" Mutable****Configuration?
How would I register those classes...
It would seem to make more difficult.

Aron
David Jencks wrote:
> So does the deafening silence that greeted this mean everyone is so 
> awed by this that they are left speechless? :-)
>
> Seriously, does anyone have any comments on this?  Does everyone 
> prefer the untyped spring style?
>
> On a related note, I've seen a lot of Mutable****Configuration classes 
> in various spots and AFAICT their only purpose is to support springs 
> troubles with constructor dependency injection.  I think there's a way 
> to use xbean-spring to make the xml style as below fit into 
> constructor dependency injection.  Any interest in this, or does 
> everyone prefer what's happening now?
>
> thanks
> david jencks
>
>
> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
>
>> A while back there was some discussion of whether server.xml could be 
>> made to be more semantically meaningful with less generic cruft, and 
>> I suggested looking into xbean-spring.  So, I spent a bit of time on 
>> it and implemented this.  See 
>> https://issues.apache.org/jira/browse/DIRSERVER-984
>>
>> This was pretty easy to do, after fixing some problems in xbean.  
>> Basically all I did was add some javadoc "annotations" to tell xbean 
>> which classes to look at and what type collections contain, and 
>> change to the xbean application context from the plain spring one.
>>
>> xbean generates a schema for the configurable objects so you can 
>> consult the schema to see what can be configured.  As you can see, 
>> you can mix regular spring configuration and the xbean style in the 
>> same server.xml.
>>
>> There's a lot more customization possible, I basically did the 
>> minimum possible to get  it to work.  Pretty much anything can have a 
>> different name.  The main ugliness I see is the handling of 
>> properties that are lists (or sets) of strings.
>>
>> So, at the risk of posting too large a message,  here's the shiny new 
>> server.xml (I removed some commented out bits) :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>>         "http://www.springframework.org/dtd/spring-beans.dtd">
>>
>> <beans>
>> <!-- bean I didn't convert -->
>>   <bean id="environment" 
>> class="org.springframework.beans.factory.config.PropertiesFactoryBean">
>>     <property name="properties">
>>       <props>
>>         <!-- JNDI security properties used to get initial 
>> contexts.         -->
>>         <prop key="java.naming.security.authentication">simple</prop>
>>         <prop 
>> key="java.naming.security.principal">uid=admin,ou=system</prop>
>>         <prop key="java.naming.security.credentials">secret</prop>
>>       </props>
>>     </property>
>>   </bean>
>>
>>
>>   <mutableServerStartupConfiguration id="configuration" 
>> xmlns="http://apacheds.org/config/1.0"
>>                                      workingDirectory="example.com"
>>                                      synchPeriodMillis="5000"
>>                                      maxThreads="8"
>>                                      allowAnonymousAccess="false"
>>                                      accessControlEnabled="false"
>>                                      denormalizeOpAttrsEnabled="false"
>>           >
>>     <ntpConfiguration>
>>       <ntpConfiguration
>>               enabled="false"
>>               ipPort="123">
>>       </ntpConfiguration>
>>     </ntpConfiguration>
>>
>>     <dnsConfiguration>
>>       <dnsConfiguration
>>               enabled="false"
>>               ipPort="53">
>>       </dnsConfiguration>
>>     </dnsConfiguration>
>>
>>     <changePasswordConfiguration>
>>       <changePasswordConfiguration
>>               enabled="false"
>>               ipPort="464">
>>       </changePasswordConfiguration>
>>     </changePasswordConfiguration>
>>
>>     <kdcConfiguration>
>>       <kdcConfiguration
>>               enabled="false"
>>               ipPort="88">
>>       </kdcConfiguration>
>>     </kdcConfiguration>
>>
>>     <ldapConfiguration>
>>       <ldapConfiguration id="ldapConfiguration"
>>               ipPort="10389"
>>               allowAnonymousAccess="false"
>>               saslHost="ldap.example.com"
>>               saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM"
>>               searchBaseDn="ou=users,ou=system"
>>               maxTimeLimit="15000"
>>               maxSizeLimit="1000">
>>
>>         <!-- The list of supported authentication 
>> mechanisms.                   -->
>>         <supportedMechanisms>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">SIMPLE</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">CRAM-MD5</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">DIGEST-MD5</value>
>>           <!--<value 
>> xmlns="http://www.springframework.org/schema/beans">GSSAPI</value>-->
>>         </supportedMechanisms>
>>
>>         <!-- The desired quality-of-protection, used by DIGEST-MD5 
>> and GSSAPI.  -->
>>         <saslQop>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">auth</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">auth-int</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">auth-conf</value>
>>         </saslQop>
>>
>>         <!-- The realms serviced by this SASL host, used by 
>> DIGEST-MD5 and GSSAPI. -->
>>         <saslRealms>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">example.com</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">apache.org</value>
>>         </saslRealms>
>>
>>         <!-- the collection of extended operation handlers to 
>> install           -->
>>         <extendedOperationHandlers>
>>           <gracefulShutdownHandler/>
>>           <launchDiagnosticUiHandler/>
>>         </extendedOperationHandlers>
>>       </ldapConfiguration>
>>     </ldapConfiguration>
>>
>>     <ldapsConfiguration>
>>       <ldapConfiguration id="ldapsConfiguration"
>>                          enabled="false"
>>                          ipPort="636"
>>                          enableLdaps="true">
>>       </ldapConfiguration>
>>     </ldapsConfiguration>
>>
>>     <systemPartitionConfiguration>
>>       <!-- use the following partitionConfiguration to override 
>> defaults for  -->
>>       <!-- the system 
>> partition                                               -->
>>       <mutableBTreePartitionConfiguration 
>> id="systemPartitionConfiguration"
>>         name="system"
>>         cacheSize="100"
>>         suffix="ou=system"
>>         optimizerEnabled="true"
>>         synchOnWrite="true">
>>         <indexedAttributes>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="ou"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="uid"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="objectClass"
>>               cacheSize="100"/>
>>         </indexedAttributes>
>>         <contextEntry>
>>           <value xmlns="http://www.springframework.org/schema/beans">
>>             objectClass: top
>>             objectClass: organizationalUnit
>>             objectClass: extensibleObject
>>             ou: system
>>           </value>
>>         </contextEntry>
>>       </mutableBTreePartitionConfiguration>
>>     </systemPartitionConfiguration>
>>
>>     <partitionConfigurations>
>>       <mutableBTreePartitionConfiguration 
>> id="examplePartitionConfiguration"
>>         name="example"
>>         cacheSize="100"
>>         suffix="dc=example,dc=com"
>>         optimizerEnabled="true"
>>         synchOnWrite="true">
>>         <indexedAttributes>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="dc"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="ou"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="krb5PrincipalName"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="uid"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="objectClass"
>>               cacheSize="100"/>
>>         </indexedAttributes>
>>         <contextEntry>
>>           <value xmlns="http://www.springframework.org/schema/beans">
>>             objectClass: top
>>             objectClass: domain
>>             objectClass: extensibleObject
>>             dc: example
>>           </value>
>>         </contextEntry>
>>       </mutableBTreePartitionConfiguration>
>>     </partitionConfigurations>
>>
>>     <interceptorConfigurations>
>>       <mutableInterceptorConfiguration
>>               name="normalizationService">
>>         <interceptor>
>>           <normalizationService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="authenticationService">
>>         <interceptor>
>>           <authenticationService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="referralService">
>>         <interceptor>
>>           <referralService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="authorizationService">
>>         <interceptor>
>>           <authorizationService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="defaultAuthorizationService">
>>         <interceptor>
>>           <defaultAuthorizationService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="exceptionService">
>>         <interceptor>
>>           <exceptionService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="operationalAttributeService">
>>         <interceptor>
>>           <operationalAttributeService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="schemaService">
>>         <interceptor>
>>           <schemaService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="subentryService">
>>         <interceptor>
>>           <subentryService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="collectiveAttributeService">
>>         <interceptor>
>>           <collectiveAttributeService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="eventService">
>>         <interceptor>
>>           <eventService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="triggerService">
>>         <interceptor>
>>           <triggerService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>
>>     </interceptorConfigurations>
>>   </mutableServerStartupConfiguration>
>>
>>
>> <!-- another bean I didn't convert -->
>>   <bean 
>> class="org.springframework.beans.factory.config.CustomEditorConfigurer">
>>     <property name="customEditors">
>>       <map>
>>         <entry key="javax.naming.directory.Attributes">
>>           <bean 
>> class="org.apache.directory.server.core.configuration.AttributesPropertyEditor"/> 
>>
>>         </entry>
>>       </map>
>>     </property>
>>   </bean>
>> </beans>
>>
>>
>> Comments?
>>
>> thanks
>> david jencks
>>
>>
>
>


Re: Simplified server configuration with xbean-spring

Posted by Ole Ersoy <ol...@gmail.com>.
Hi David,

I thought it was very cool.  The more semantic meaning, the better.  Two thumbs way up here :-)

Cheers,
- Ole

 

David Jencks wrote:
> So does the deafening silence that greeted this mean everyone is so awed 
> by this that they are left speechless? :-)
> 
> Seriously, does anyone have any comments on this?  Does everyone prefer 
> the untyped spring style?
> 
> On a related note, I've seen a lot of Mutable****Configuration classes 
> in various spots and AFAICT their only purpose is to support springs 
> troubles with constructor dependency injection.  I think there's a way 
> to use xbean-spring to make the xml style as below fit into constructor 
> dependency injection.  Any interest in this, or does everyone prefer 
> what's happening now?
> 
> thanks
> david jencks
> 
> 
> On Jun 28, 2007, at 4:17 PM, David Jencks wrote:
> 
>> A while back there was some discussion of whether server.xml could be 
>> made to be more semantically meaningful with less generic cruft, and I 
>> suggested looking into xbean-spring.  So, I spent a bit of time on it 
>> and implemented this.  See 
>> https://issues.apache.org/jira/browse/DIRSERVER-984
>>
>> This was pretty easy to do, after fixing some problems in xbean.  
>> Basically all I did was add some javadoc "annotations" to tell xbean 
>> which classes to look at and what type collections contain, and change 
>> to the xbean application context from the plain spring one.
>>
>> xbean generates a schema for the configurable objects so you can 
>> consult the schema to see what can be configured.  As you can see, you 
>> can mix regular spring configuration and the xbean style in the same 
>> server.xml.
>>
>> There's a lot more customization possible, I basically did the minimum 
>> possible to get  it to work.  Pretty much anything can have a 
>> different name.  The main ugliness I see is the handling of properties 
>> that are lists (or sets) of strings.
>>
>> So, at the risk of posting too large a message,  here's the shiny new 
>> server.xml (I removed some commented out bits) :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
>>         "http://www.springframework.org/dtd/spring-beans.dtd">
>>
>> <beans>
>> <!-- bean I didn't convert -->
>>   <bean id="environment" 
>> class="org.springframework.beans.factory.config.PropertiesFactoryBean">
>>     <property name="properties">
>>       <props>
>>         <!-- JNDI security properties used to get initial 
>> contexts.         -->
>>         <prop key="java.naming.security.authentication">simple</prop>
>>         <prop 
>> key="java.naming.security.principal">uid=admin,ou=system</prop>
>>         <prop key="java.naming.security.credentials">secret</prop>
>>       </props>
>>     </property>
>>   </bean>
>>
>>
>>   <mutableServerStartupConfiguration id="configuration" 
>> xmlns="http://apacheds.org/config/1.0"
>>                                      workingDirectory="example.com"
>>                                      synchPeriodMillis="5000"
>>                                      maxThreads="8"
>>                                      allowAnonymousAccess="false"
>>                                      accessControlEnabled="false"
>>                                      denormalizeOpAttrsEnabled="false"
>>           >
>>     <ntpConfiguration>
>>       <ntpConfiguration
>>               enabled="false"
>>               ipPort="123">
>>       </ntpConfiguration>
>>     </ntpConfiguration>
>>
>>     <dnsConfiguration>
>>       <dnsConfiguration
>>               enabled="false"
>>               ipPort="53">
>>       </dnsConfiguration>
>>     </dnsConfiguration>
>>
>>     <changePasswordConfiguration>
>>       <changePasswordConfiguration
>>               enabled="false"
>>               ipPort="464">
>>       </changePasswordConfiguration>
>>     </changePasswordConfiguration>
>>
>>     <kdcConfiguration>
>>       <kdcConfiguration
>>               enabled="false"
>>               ipPort="88">
>>       </kdcConfiguration>
>>     </kdcConfiguration>
>>
>>     <ldapConfiguration>
>>       <ldapConfiguration id="ldapConfiguration"
>>               ipPort="10389"
>>               allowAnonymousAccess="false"
>>               saslHost="ldap.example.com"
>>               saslPrincipal="ldap/ldap.example.com@EXAMPLE.COM"
>>               searchBaseDn="ou=users,ou=system"
>>               maxTimeLimit="15000"
>>               maxSizeLimit="1000">
>>
>>         <!-- The list of supported authentication 
>> mechanisms.                   -->
>>         <supportedMechanisms>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">SIMPLE</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">CRAM-MD5</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">DIGEST-MD5</value>
>>           <!--<value 
>> xmlns="http://www.springframework.org/schema/beans">GSSAPI</value>-->
>>         </supportedMechanisms>
>>
>>         <!-- The desired quality-of-protection, used by DIGEST-MD5 and 
>> GSSAPI.  -->
>>         <saslQop>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">auth</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">auth-int</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">auth-conf</value>
>>         </saslQop>
>>
>>         <!-- The realms serviced by this SASL host, used by DIGEST-MD5 
>> and GSSAPI. -->
>>         <saslRealms>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">example.com</value>
>>           <value 
>> xmlns="http://www.springframework.org/schema/beans">apache.org</value>
>>         </saslRealms>
>>
>>         <!-- the collection of extended operation handlers to 
>> install           -->
>>         <extendedOperationHandlers>
>>           <gracefulShutdownHandler/>
>>           <launchDiagnosticUiHandler/>
>>         </extendedOperationHandlers>
>>       </ldapConfiguration>
>>     </ldapConfiguration>
>>
>>     <ldapsConfiguration>
>>       <ldapConfiguration id="ldapsConfiguration"
>>                          enabled="false"
>>                          ipPort="636"
>>                          enableLdaps="true">
>>       </ldapConfiguration>
>>     </ldapsConfiguration>
>>
>>     <systemPartitionConfiguration>
>>       <!-- use the following partitionConfiguration to override 
>> defaults for  -->
>>       <!-- the system 
>> partition                                               -->
>>       <mutableBTreePartitionConfiguration 
>> id="systemPartitionConfiguration"
>>         name="system"
>>         cacheSize="100"
>>         suffix="ou=system"
>>         optimizerEnabled="true"
>>         synchOnWrite="true">
>>         <indexedAttributes>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="ou"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="uid"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="objectClass"
>>               cacheSize="100"/>
>>         </indexedAttributes>
>>         <contextEntry>
>>           <value xmlns="http://www.springframework.org/schema/beans">
>>             objectClass: top
>>             objectClass: organizationalUnit
>>             objectClass: extensibleObject
>>             ou: system
>>           </value>
>>         </contextEntry>
>>       </mutableBTreePartitionConfiguration>
>>     </systemPartitionConfiguration>
>>
>>     <partitionConfigurations>
>>       <mutableBTreePartitionConfiguration 
>> id="examplePartitionConfiguration"
>>         name="example"
>>         cacheSize="100"
>>         suffix="dc=example,dc=com"
>>         optimizerEnabled="true"
>>         synchOnWrite="true">
>>         <indexedAttributes>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.1"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.2"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.3"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.4"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.5"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.6"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="1.3.6.1.4.1.18060.0.4.1.2.7"
>>               cacheSize="10"/>
>>             <mutableIndexConfiguration
>>               attributeId="dc"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="ou"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="krb5PrincipalName"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="uid"
>>               cacheSize="100"/>
>>             <mutableIndexConfiguration
>>               attributeId="objectClass"
>>               cacheSize="100"/>
>>         </indexedAttributes>
>>         <contextEntry>
>>           <value xmlns="http://www.springframework.org/schema/beans">
>>             objectClass: top
>>             objectClass: domain
>>             objectClass: extensibleObject
>>             dc: example
>>           </value>
>>         </contextEntry>
>>       </mutableBTreePartitionConfiguration>
>>     </partitionConfigurations>
>>
>>     <interceptorConfigurations>
>>       <mutableInterceptorConfiguration
>>               name="normalizationService">
>>         <interceptor>
>>           <normalizationService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="authenticationService">
>>         <interceptor>
>>           <authenticationService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="referralService">
>>         <interceptor>
>>           <referralService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="authorizationService">
>>         <interceptor>
>>           <authorizationService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="defaultAuthorizationService">
>>         <interceptor>
>>           <defaultAuthorizationService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="exceptionService">
>>         <interceptor>
>>           <exceptionService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="operationalAttributeService">
>>         <interceptor>
>>           <operationalAttributeService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="schemaService">
>>         <interceptor>
>>           <schemaService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="subentryService">
>>         <interceptor>
>>           <subentryService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="collectiveAttributeService">
>>         <interceptor>
>>           <collectiveAttributeService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="eventService">
>>         <interceptor>
>>           <eventService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>       <mutableInterceptorConfiguration
>>               name="triggerService">
>>         <interceptor>
>>           <triggerService/>
>>         </interceptor>
>>       </mutableInterceptorConfiguration>
>>
>>     </interceptorConfigurations>
>>   </mutableServerStartupConfiguration>
>>
>>
>> <!-- another bean I didn't convert -->
>>   <bean 
>> class="org.springframework.beans.factory.config.CustomEditorConfigurer">
>>     <property name="customEditors">
>>       <map>
>>         <entry key="javax.naming.directory.Attributes">
>>           <bean 
>> class="org.apache.directory.server.core.configuration.AttributesPropertyEditor"/> 
>>
>>         </entry>
>>       </map>
>>     </property>
>>   </bean>
>> </beans>
>>
>>
>> Comments?
>>
>> thanks
>> david jencks
>>
>>
> 
>