Hi guys,

I'm trying to do something that is not that specific : on a client tool,
load a SchemaManager with all the default schema presents (enabled and
disabled), then load a new external schema. And I'm hitting a wall here
: there is no simple way to get a schema which is not present in the
list of existing schemas being added afterward.

This is quite a pain, and I'd like to extend the SchemaManager interface
to allow something like : SchemaManager.add( String schemaFile[,
SchemaLoader] ).

This is not exactly simple, considering the format this schema file will
use. We have three kind of supported formats :
- ldif : one ldif file per schema element
- single ldif : one single ldif file containing all the elements
- JAR : a jar file containing a ldif format schema (1 format)

When you create a schemaManager, you inject a SchemaLoader into it, and
this is used for the lifetime of this SchemaManager. That makes it
impossible to use another SchemaLoader than the one that has been used
initially. Sadly, we still need the previous SchemaLoader because we
don't process all the schemas when we initialize the SchemaManager : the
disabled schemas aren't read at all. So we may need it later, if the
newly added schema requires a dependency from the old SchemaLoader.

At this point, I'm a bit stuck with the current API, and even though
there are some ways to deal with that, none of the solution is
convenient from a User POV, and we are talking about an API here.


So the solution I will come with is to associate each Schema with its
schema loader, instead of associate the SchemaLoader to the
SchemaManager. This way, we will be able to have more than one
SchemaLoader used by the SchemaManager.


Another thing : we do need a OpenLDAPSchemaLoader, able to process
OpenLDAP schema formatted files (currently all our schemaLoaders just
swallow LDIF files, which is far form being convenient). We have all the
logic available to parse OpenLDAP schemas, it's just a matter of
wrapping that into a dedicated SchemaLoader.

Thoughts ?

Reply via email to