Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 39560 invoked from network); 6 Dec 2010 14:14:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Dec 2010 14:14:42 -0000 Received: (qmail 8081 invoked by uid 500); 6 Dec 2010 14:14:42 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 7873 invoked by uid 500); 6 Dec 2010 14:14:40 -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 7866 invoked by uid 99); 6 Dec 2010 14:14:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 14:14:40 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of antoine@gmx.de designates 213.165.64.22 as permitted sender) Received: from [213.165.64.22] (HELO mail.gmx.net) (213.165.64.22) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Dec 2010 14:14:31 +0000 Received: (qmail invoked by alias); 06 Dec 2010 14:14:10 -0000 Received: from unknown (EHLO [192.168.94.119]) [38.100.172.138] by mail.gmx.net (mp060) with SMTP; 06 Dec 2010 15:14:10 +0100 X-Authenticated: #22961642 X-Provags-ID: V01U2FsdGVkX1/Kv2lmuVjK3+oVCOBq/8/9xEiDG4Gje2oM0Bxvyi /mdh3l+5teg8Yy Message-ID: <4CFCF01B.2090503@gmx.de> Date: Mon, 06 Dec 2010 09:15:55 -0500 From: Antoine Levy-Lambert User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Adding annotations to Configuration beans References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org On 12/6/2010 9:02 AM, Pierre-Arnaud Marcelot wrote: > Hi Dev, > > I successfully integrated the newly introduced ApacheDS Configuration Reader (with all configuration beans) in the ApacheDS 2.0 Configuration Editor for Apache Directory Studio. > The UI is not completely finished yet, but I can already load a configuration from an LDIF file and I have access to the values of each bean. It's working really great... > > Now, that the configuration can be read, it also need to be written, and I started working on a Configuration Writer. > > In order to achieve this, I'd like to propose the addition of several Annotation elements that would be used in the Configuration Beans to help both the configuration writer and the reader. > Adding these Annotation elements would help maintaining the reader and writer loosely coupled with the beans and would facilitate additions of new configuration items (like those needed by Antoine, or others from third parties implementations). > > There 3 annotations I'd like to introduce: > > - @AttributeType( attributeTypeId ) > This annotation is intended to be used on a field of a configuration bean and indicates which attribute type id this field is associated with. > I think it's a great addition as we're no longer in need to infer the id of the attribute type from the name of the field ( same thing for having to truncate the 'ads-' prefix sometimes). > It's clear and easy. > Furthermore, only fields with this annotation should be read and written by the configuration reader/writer (which allows the configuration beans to have extra fields that are not necessarily read or written). > > - @RDN > This annotation is intended to be used on a field of a configuration bean in conjunction with the @AttibuteType annotation and indicates that this particular field is the one (and only for a given configuration bean) to be used in the RDN of the associated entry > > - @Container( containerRdn ) > This is intended to be used on a field of a configuration bean and more particularly on a field referring to a composite (List, Set, etc.) bean value. It indicates where the adding bean entries are to be placed (in which container entry) like the 'ou=servers' entry under the defaultDirectoryService entry. Once you have @Container annotations, maybe the ads-composite attributes can be removed ? I think they only exist as a hint to the configuration reader that there are subentries to be read. > Any thoughts on this? > > Thanks, > Pierre-Arnaud +1 Antoine