Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 58914 invoked from network); 15 Nov 2006 09:32:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2006 09:32:02 -0000 Received: (qmail 28057 invoked by uid 500); 15 Nov 2006 09:32:02 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 28047 invoked by uid 500); 15 Nov 2006 09:32:02 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 28037 invoked by uid 99); 15 Nov 2006 09:32:02 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jukka.zitting@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 01:31:58 -0800 Received: by nf-out-0910.google.com with SMTP id x4so642580nfb for ; Wed, 15 Nov 2006 01:30:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hkHuxzY+W3CRVQOU4XRcaVGd9t3hFmHRdxZ+RpFig5a2EOcsy/XytdSZ/8s1xMwlKLRcSnYF9ehY3O5v93VHDzkAMJ+KtNx8iTsbE3z805NHJptxovVyrlDJaXXBFQLXbYI3aWhwRord6y5Mn3bDoU7XDW/gW/E5f3WYNBvM3NA= Received: by 10.78.83.13 with SMTP id g13mr2185935hub.1163583000151; Wed, 15 Nov 2006 01:30:00 -0800 (PST) Received: by 10.78.175.15 with HTTP; Wed, 15 Nov 2006 01:29:59 -0800 (PST) Message-ID: <510143ac0611150129y4a428476o1de8a5dc46cdde7b@mail.gmail.com> Date: Wed, 15 Nov 2006 11:30:00 +0200 From: "Jukka Zitting" To: users@jackrabbit.apache.org Subject: Re: Checking existence of the repository In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2f35a2640611150041jeb005adl7206c1fc8a946ae5@mail.gmail.com> <510143ac0611150049jb10fbcfk95538a3f42593db6@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, On 11/15/06, Nicolas wrote: > I had a similar issue (on the backup tool), maybe it could be a good > addition to write a small method to check for the existence of a specific > NodeType and a Namespace. See the NamespaceRegistryImpl.safeRegisterNamespace() method that achieves the full use case for namespaces. It's an internal Jackrabbit method, so I wouldn't advocate using it from general JCR clients, but the backup tool can well use it. > It seems to be a common use case and catching exception for this is not a > good practice, although not JCR compliant. Catching the esceptions is JCR compliant. I don't think it makes much sense to add Jackrabbit specific extensions for doing this, the extra benefit of having a boolean return value from something like isNamespaceRegistered() or nodeTypeExists() instead of catching the respective exception is rather minor (both achieve the same result, and the use case is quite rare), so it definitely wouldn't justify adding a direct Jackrabbit dependency to a client. You may want to send the suggestion to jsr-283-comments@jcp.org for consideration in JCR 2.0, but at least I would be intuitively against adding such utility methods since the need for them is quite limited. BR, Jukka Zitting