Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-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 D8CCC11180 for ; Wed, 18 Jun 2014 03:02:12 +0000 (UTC) Received: (qmail 31381 invoked by uid 500); 18 Jun 2014 03:02:12 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 31318 invoked by uid 500); 18 Jun 2014 03:02:12 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 31299 invoked by uid 99); 18 Jun 2014 03:02:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jun 2014 03:02:12 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of boards@gmail.com designates 209.85.219.52 as permitted sender) Received: from [209.85.219.52] (HELO mail-oa0-f52.google.com) (209.85.219.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jun 2014 03:02:10 +0000 Received: by mail-oa0-f52.google.com with SMTP id j17so501119oag.39 for ; Tue, 17 Jun 2014 20:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=LN65ZiPWvA11QSHFqEndhqMR8w4YfO6KGoyQ7e8Zdzg=; b=i9kWC90x69zICQYiEFsDvgYdE6LMVjUsVaA516oSKLxY7iIG7OgLVOfSMR+VvhNfXo a0W2Iu5IycD429LvBc0AKJWIvRPIRozONUpk2GGxDZVggH5Lqe6gowv1+5wu/ZbLwnoC qr5msdqlQZv/Qxy0B8kPvYrXzFGWaIweByMRMgBZtWkbSeCoBGMC8rbkdrSZ1bID4bKW pGQJ8sDt1F5Cza8z2mvkytRKEZoGic7ecMuYvsf05Xpzfv7rJmj7V4wBrBN/CFj8+ljN 2tfep4vPfwbZ4+hoFSrmsljofGqQ+3R57L/zTC7tyMds8NiBhnHpqr73eSMHce/QSNU7 HrrA== MIME-Version: 1.0 X-Received: by 10.182.243.163 with SMTP id wz3mr29566011obc.3.1403060505421; Tue, 17 Jun 2014 20:01:45 -0700 (PDT) Received: by 10.76.128.171 with HTTP; Tue, 17 Jun 2014 20:01:45 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Jun 2014 22:01:45 -0500 Message-ID: Subject: Re: Component Design Question From: Matt Sicker To: dev@camel.apache.org Content-Type: multipart/alternative; boundary=001a11c2a57206327304fc137b56 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2a57206327304fc137b56 Content-Type: text/plain; charset=UTF-8 Having type converters available for everything helps a lot in minimising the need to worry about return formats. You could by default return the native Node objects and provide type converters to List>. On 17 June 2014 20:54, Gregor Zurowski wrote: > Hi Everyone: > > A recent discussion on the camel-users list [1] showed that the > camel-jcr component needs some enhancements to better support > real-world use cases. I would like to add query functionality, so that > users are able to submit JCR-SQL or JCR-XPath queries and retrieve > matching nodes. A possible implementation could look as follows: > > - Add support for new values to CamelJcrOperation header with the > names "JcrQuerySql" and "JcrQueryXPath" for triggering queries by the > producer. > - The actual query is read from the body of the IN message. > - Matching nodes are returned in the body of the OUT message. > > The question is how to return the resulting nodes? I considered the > following approaches: > > 1) Simply return an array of strings where each string is the UUID of > a matching node, e.g. [c042662a-f5be-11e3-8344-b2227cce2b54, > c0426b5c-f5be-11e3-8344-b2227cce2b54, ...]. The downside of this > approach is that the client would need to submit follow-up requests > for each UUID (e.g. with the CamelJcrGetById operation). > > 2) Return a list of javax.jcr.Node [2] instances of all matching > nodes. This is similar to what the current consumer implementation > returns (which is a list of javax.jcr.observation.Event instances). > > 3) Return a list of custom items. Each item is a translated version of > the javax.jcr.Node type where each field was converted into a common > Java type (similar to what the camel-cmis component is doing when > translating CMIS query results into a List> data > structure). > > What would be the best approach to return query results by the > producer, i.e. what would be the Camel-way of returning the results? > > Thanks in advance, > Gregor > > [1] http://camel.465427.n5.nabble.com/Camel-JCR-examples-td5746406.html > [2] http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html > -- Matt Sicker --001a11c2a57206327304fc137b56--