Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 13130 invoked from network); 30 Sep 2009 00:04:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Sep 2009 00:04:09 -0000 Received: (qmail 93079 invoked by uid 500); 30 Sep 2009 00:04:08 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 92999 invoked by uid 500); 30 Sep 2009 00:04:08 -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 92991 invoked by uid 99); 30 Sep 2009 00:04:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Sep 2009 00:04:08 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of elecharny@gmail.com designates 209.85.219.205 as permitted sender) Received: from [209.85.219.205] (HELO mail-ew0-f205.google.com) (209.85.219.205) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Sep 2009 00:03:58 +0000 Received: by ewy1 with SMTP id 1so2853669ewy.3 for ; Tue, 29 Sep 2009 17:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=rmf/XQ5c0xcOb/kh3wgVV4KZAyZC8W/WjebmhtOQEOc=; b=DKmneTTsdpt6BpwEdwwN9Xa7KEDyDJ/mTpc3iJ8SJtDo4BIHi0V4J7vuENpV0X9xoY krbBdm5aVDm0Y1DYghqqk9BbZ18wNKbeMiizQ0fiE4qNU+iU/yypGpQGvHwH2hlyqyqL rHtaf6VGW+MTRA9LvJI5V4ywUOmljoXtcjYro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=Ww3Y9ff/3zKhesJW5sW3VXIWZGarcJSemmSyagDlxTN0euBUUricypht2gawjcynn/ CnA7lGfER3/3DSCNjrAEXlWuQcAFyUsDyMdwEbEGuzwdxUHjs+hARlcjccWtL0KWzkJ3 oo/nJObeBCKColamSps6SJY7RgfGPPD5K3KwY= Received: by 10.210.9.5 with SMTP id 5mr5281279ebi.78.1254269017046; Tue, 29 Sep 2009 17:03:37 -0700 (PDT) Received: from ?192.168.0.51? (vol75-3-82-66-216-176.fbx.proxad.net [82.66.216.176]) by mx.google.com with ESMTPS id 5sm450581eyh.24.2009.09.29.17.03.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Sep 2009 17:03:35 -0700 (PDT) Sender: Emmanuel Lecharny Message-ID: <4AC2A057.6020306@nextury.com> Date: Wed, 30 Sep 2009 02:03:35 +0200 From: Emmanuel Lecharny User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Apache Directory Developers List Subject: Small tool for tests Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi guys, while being in Portland, I saw a slide from Neil Willson where he shown something like a helper method to create entries using a LDIF format, but using multi-attributes instead of using a single string. I have create such a static method in AttributeUtils. Instead of doing that in your code : Attributes attrs = new BasicAttributes( true ); Attribute oc = new BasicAttribute( "objectClass", "top" ); oc.add( "metaTop" ); oc.add( "metaAttributeType" ); attrs.put( oc ); attrs.put( "m-oid", OID ); attrs.put( "m-syntax", SchemaConstants.INTEGER_SYNTAX ); attrs.put( "m-description", DESCRIPTION0 ); attrs.put( "m-equality", "caseIgnoreMatch" ); attrs.put( "m-singleValue", "FALSE" ); attrs.put( "m-usage", "directoryOperation" ); do now : Attributes attrs = AttributeUtils.createAttributes( "objectClass: top", "objectClass: metaTop", "objectClass: metaAttributeType", "m-oid:" + OID, "m-syntax:" + SchemaConstants.INTEGER_SYNTAX, "m-description:" + DESCRIPTION0, "m-equality: caseIgnoreMatch", "m-singleValue: FALSE", "m-usage: directoryOperation" ); Way better ! And thanks Neil for the idea ! -- -- cordialement, regards, Emmanuel L�charny www.iktek.com directory.apache.org