Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AF1A1958C for ; Mon, 6 Feb 2012 14:11:37 +0000 (UTC) Received: (qmail 12743 invoked by uid 500); 6 Feb 2012 14:11:37 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 12694 invoked by uid 500); 6 Feb 2012 14:11:36 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 12687 invoked by uid 99); 6 Feb 2012 14:11:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 14:11:36 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 14:11:28 +0000 Received: by wgbdt10 with SMTP id dt10so6260664wgb.1 for ; Mon, 06 Feb 2012 06:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=azSpEOC6kCx+Hb4Xs2wlKb6cp4wQkHh62UwLbXqLZHQ=; b=Taya5Ex/0/Vrp5Gec0pwhERy1F2EzoJ4SVx/9/vBwO/4jOD8Xvrnbzbz6X6lAEBvVn FxayhXEx6tTml+lEpCoXmYFDUH0H0G4mGDQ/po/DlceZCV2PunBe8TCx/ZpDSuClOnRD Tr3p0Sm+jqIyjKB6hmT2HaVb5/HCXMn+3QB/8= Received: by 10.180.79.229 with SMTP id m5mr4216792wix.6.1328537467645; Mon, 06 Feb 2012 06:11:07 -0800 (PST) Received: from emmanuel-lecharnys-MacBook-Pro.local (lon92-10-78-226-4-211.fbx.proxad.net. [78.226.4.211]) by mx.google.com with ESMTPS id q2sm25538680wiy.7.2012.02.06.06.11.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Feb 2012 06:11:07 -0800 (PST) Message-ID: <4F2FDF79.8070502@gmail.com> Date: Mon, 06 Feb 2012 15:11:05 +0100 From: Emmanuel Lecharny Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Schema handling in the API : a sum up Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org So let me summarize many aspects we have discussed about the schema handling in the API in this mail. From the API POV, we should distinguish four cases : - we don't want to load any schema - we want to load a schema from a LDAP server - we want to load a local schema (ie, from some files) Case 1 : if we don't load any schema, then we won't have a SchemaManager, and the API will not be schema aware. This is what happens if you create a connection, and don't explicitely load a schema. So far, we already can work this way. Case 2 : here, we connect to the server, and load the schema which is stored in the subschemaSubentry. This is done using the LdapConnection.loadSchema() method, which reads the schema from the SubschemaSubentry Case 3 : we have 4 different schema loaders, depending on the file format that contains the schema (Multiple Ldif files, Single Ldif file, Jar, XML/OpenLDAP format files). In order to load a schema using one of those format, we just have to create a SchemaManager, passing it a SchemaLoader. If we want to use this SchemaManager in a connection, we can pass it using the LdapConnection.setSchemaManager( schemaManager ) method (note : this method must be added to the interface). It's also possible to do it directly by calling the LdapConnection.loadSchema( SchemaLoader ), without creating a SchemaManager. In any case, the third case is to be used by advanced users, most of the users will either use the first or second solution. Regarding the SchemaLoader names, we should keep it simple and explicit. Here are some suggestions : - DefaultSchemaLoader : loads the schema from the SubschemaSubentry. It's currently named SsseSchemaLoader. - (Ldif|JarLdif|SingleLdif)SchemaLoader : all the different format we support in ApacheDS. - SchemaEditorSchemaLoader : loads the schema from a XML file or an OpenLDAP format - SchemaPartitionSchemaLoader : This is to read the Schema from the Apacheds ou=schema partition Also it would be good to move the ApacheDS specific SchemaLoader instances (ie, (Ldif|JarLdif|SingleLdif)SchemaLoader and SchemaPartitionSchemaLoader) into the ApacheDS project, as they don't belongs to the API. This will impact the tests, and we wil probably need to create a new projects to hold all the attached tests. Thoughts ? -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com