Return-Path: Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: (qmail 81747 invoked from network); 11 Mar 2011 15:16:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Mar 2011 15:16:27 -0000 Received: (qmail 48906 invoked by uid 500); 11 Mar 2011 15:16:27 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 48860 invoked by uid 500); 11 Mar 2011 15:16:26 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 48852 invoked by uid 99); 11 Mar 2011 15:16:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2011 15:16:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2011 15:16:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6F8AF23889EB; Fri, 11 Mar 2011 15:15:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1080596 - in /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub: AbstractAtomPubService.java LinkAccess.java Date: Fri, 11 Mar 2011 15:15:51 -0000 To: commits@chemistry.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110311151551.6F8AF23889EB@eris.apache.org> Author: fmui Date: Fri Mar 11 15:15:51 2011 New Revision: 1080596 URL: http://svn.apache.org/viewvc?rev=1080596&view=rev Log: CMIS-330: Allow access to AtomPub links Added: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkAccess.java (with props) Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java?rev=1080596&r1=1080595&r2=1080596&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java Fri Mar 11 15:15:51 2011 @@ -73,7 +73,7 @@ import org.apache.chemistry.opencmis.com /** * Base class for all AtomPub clients. */ -public class AbstractAtomPubService { +public class AbstractAtomPubService implements LinkAccess { protected enum IdentifierType { ID, PATH @@ -154,7 +154,7 @@ public class AbstractAtomPubService { * Gets a link from the cache if it is there or loads it into the cache if * it is not there. */ - protected String loadLink(String repositoryId, String id, String rel, String type) { + public String loadLink(String repositoryId, String id, String rel, String type) { String link = getLink(repositoryId, id, rel, type); if (link == null) { getObjectInternal(repositoryId, IdentifierType.ID, id, ReturnVersion.THIS, null, null, null, null, null, @@ -166,6 +166,14 @@ public class AbstractAtomPubService { } /** + * Gets the content link from the cache if it is there or loads it into the + * cache if it is not there. + */ + public String loadContentLink(String repositoryId, String id) { + return loadLink(repositoryId, id, AtomPubParser.LINK_REL_CONTENT, null); + } + + /** * Adds a link to the cache. */ protected void addLink(String repositoryId, String id, String rel, String type, String link) { @@ -511,7 +519,8 @@ public class AbstractAtomPubService { * Performs a PUT on an URL, checks the response code and returns the * result. */ - protected HttpUtils.Response put(UrlBuilder url, String contentType, Map headers, HttpUtils.Output writer) { + protected HttpUtils.Response put(UrlBuilder url, String contentType, Map headers, + HttpUtils.Output writer) { // make the call HttpUtils.Response resp = HttpUtils.invokePUT(url, contentType, headers, writer, session); Added: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkAccess.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkAccess.java?rev=1080596&view=auto ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkAccess.java (added) +++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkAccess.java Fri Mar 11 15:15:51 2011 @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.chemistry.opencmis.client.bindings.spi.atompub; + +public interface LinkAccess { + + /** + * Gets a link from the cache if it is there or loads it into the cache if + * it is not there. + */ + String loadLink(String repositoryId, String objectId, String rel, String type); + + /** + * Gets the content link from the cache if it is there or loads it into the + * cache if it is not there. + */ + String loadContentLink(String repositoryId, String documentId); +} Propchange: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/LinkAccess.java ------------------------------------------------------------------------------ svn:eol-style = native