On Mon, Mar 1, 2010 at 11:50, Thomas Müller <[email protected]> wrote: > String factoryClass = "..."; > String url = "...?user=sa&password=xyz"; > RepositoryFactory factory = (RepositoryFactory) > Class.forName(factoryClass).newInstance(); > Map<String, String> parameters = new HashMap<String, String>(); > parameters.put("url", url); > Repository rep = factory.getRepository(parameters); > > In this case the user name and password are included in the repository > URL. This solution is almost what we have how (except there is no > repository.xml). > > What I propose is: Jackrabbit should support the following use case as well: > > String factoryClass = "..."; > String url = "..."; > RepositoryFactory factory = (RepositoryFactory) > Class.forName(factoryClass).newInstance(); > Map<String, String> parameters = new HashMap<String, String>(); > parameters.put("url", url); > Repository rep = factory.getRepository(parameters); > Session session = rep.login(new SimpleCredentials("sa", "xyz".toCharArray())); > > Here, the user name and password of the storage backend (for example a > relational database) are not included in the repository URL. Instead, > they are supplied in the first session that logs into the repository. > Currently this use case is not supported. I suggest that Jackrabbit 3 > support this as a possible use case (not necessarily as the default > use case).
Couldn't this be done by a special wrapping Repository implementation? Supposing the configuration of the "actual" RepositoryImpl is dynamically configurable w/o repository.xml, as it is planned. I think the use case for short configs via URL (like "...?user=sa&password=xyz" above) is valid and it's a good idea to support that. For performance reasons in a production instance it probably doesn't make a big difference, since there will typically be at least one (admin) session immediately logging in once the repository is up. Regards, Alex -- Alexander Klimetschek [email protected]
