Return-Path: X-Original-To: apmail-sling-dev-archive@www.apache.org Delivered-To: apmail-sling-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 1218510BBB for ; Wed, 2 Oct 2013 12:06:35 +0000 (UTC) Received: (qmail 31275 invoked by uid 500); 2 Oct 2013 12:06:34 -0000 Delivered-To: apmail-sling-dev-archive@sling.apache.org Received: (qmail 31030 invoked by uid 500); 2 Oct 2013 12:06:34 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 31018 invoked by uid 99); 2 Oct 2013 12:06:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 12:06:33 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [46.4.97.245] (HELO s77.linuxpl.com) (46.4.97.245) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Oct 2013 12:06:28 +0000 Received: from mail-ve0-f182.google.com ([209.85.128.182]) by s77.linuxpl.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.76) (envelope-from ) id 1VRLBs-0001KX-TZ for dev@sling.apache.org; Wed, 02 Oct 2013 14:06:05 +0200 Received: by mail-ve0-f182.google.com with SMTP id oy12so422680veb.41 for ; Wed, 02 Oct 2013 05:06:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=sUyb6ruX/sfPHEHODl1MQ/zDhLVqzVxEjuAWg422H74=; b=BcS9JG+SlbrSF32pjbhOeIjJpY1faooI0gnmPiTRNaDfzau1afjxaggZqN7Iaa8Gzv nziOBdd/ELleKgJqlt2WuHSlV3fnttuRcED6/qQJbilOSZcameYWfSu+ar4l1ZNenMFo TqzYECDjCFJn1YL8EUSLBtCNS8PR8LwWG01chGmdz+jMVjUyt7FRxBJZQioZBvRpexSi tl0RyQAs+yhq/DCu6CKdja24YSl4dwla1HUS9VIyIpt9lidzU7mlcFh9kDNICOs52h5q S5X8LT13B2dQcpA//9JFHc75gRtmmL2ctFRbzI6b2up3IUPrCupuYc2/l23JBaMRuSxN 1u/g== MIME-Version: 1.0 X-Received: by 10.58.201.73 with SMTP id jy9mr1768026vec.20.1380715564788; Wed, 02 Oct 2013 05:06:04 -0700 (PDT) Received: by 10.52.48.146 with HTTP; Wed, 2 Oct 2013 05:06:04 -0700 (PDT) In-Reply-To: References: Date: Wed, 2 Oct 2013 14:06:04 +0200 Message-ID: Subject: Re: [DISCUSS] Generic ServiceMap for ServiceResolver From: Mike Hummel To: dev@sling.apache.org Content-Type: multipart/alternative; boundary=047d7b677afac6726704e7c0e48c X-Virus-Checked: Checked by ClamAV on apache.org --047d7b677afac6726704e7c0e48c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In my understanding the service registry is not able to differ between the resource implementations like mongo or jcr. If the operation is provided from the resource provider it is specialised for the underlying implementation. This is what you need for ResourceSecurityAccess or manipulating rights on the resource - without knowledge of the underlying data store. 2013/10/1 Carsten Ziegeler > Hi, > > I'm not sure I completely understand your proposal. What's the difference > to looking up the MoveOperation (or other services) directly from the > service registry? > > Carsten > > > 2013/9/30 Mike Hummel > > > Hi, > > > > with ResourceAccessSecurity there's the first service depending on the > > ServiceResolver and loaded by the ServiceTracker. For further services = we > > should use a generic way to handle this. > > > > Another goal is that we can implement operations in this way for > different > > ServiceResolver in a generic way. For example default operations like > > 'move' 'copy' 'checkout' 'checkin' can then be implemented for differen= t > > Resources (jcr, mongodb). > > > > On next step it can be used by the post servlet to access it via REST. > > > > I implemented a try like this > > > > public interface ServiceMap { > > > > > > /** > > > > * Return the instance of the Service for the requested interface > > > > * > > > > * @param requestedInterface The Service or null if not found > > > > * @return > > > > */ > > > > T getService(Class requestedInterface); > > > > } > > > > public interface ResourceResolver { > > > > =E2=80=A6 > > > > /** > > > > * Return the service map for this resolver. > > > > * > > > > * @return > > > > */ > > > > ServiceMap getServiceMap(); > > > > } > > > > To use a service use > > > > ResourceAccessSecurity service =3D > > > > > resource.getResourceResolver().getServiceMap().getService(ResourceAccessS= ecurity.class); > > > > or maybe > > > > MoveOperation service =3D > > > > > resource.getResourceResolver().getServiceMap().getService(MoveOperation.c= lass); > > service.move(resource,targetPath); > > > > Ok, what's the goal? > > > > 1. We do not need to change resource providers if we initiate a new > service > > for resources > > 2. A generic way to access operations if the service implement an > > Operation-Interface via REST / Post-Servlet > > > > What do you think? > > > > Mike > > > > > > -- > Carsten Ziegeler > cziegeler@apache.org > --047d7b677afac6726704e7c0e48c--