You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by md...@apache.org on 2015/06/11 14:09:17 UTC

svn commit: r1684861 [1/8] - in /jackrabbit/oak/trunk: ./ oak-remote/ oak-remote/src/ oak-remote/src/main/ oak-remote/src/main/java/ oak-remote/src/main/java/org/ oak-remote/src/main/java/org/apache/ oak-remote/src/main/java/org/apache/jackrabbit/ oak-...

Author: mduerig
Date: Thu Jun 11 12:09:15 2015
New Revision: 1684861

URL: http://svn.apache.org/r1684861
Log:
OAK-2502: Provide initial implementation of the Remote Operations specification
Initial implementation contributed by Francesco Mari

Added:
    jackrabbit/oak/trunk/oak-remote/
    jackrabbit/oak/trunk/oak-remote/pom.xml
    jackrabbit/oak/trunk/oak-remote/src/
    jackrabbit/oak/trunk/oak-remote/src/main/
    jackrabbit/oak/trunk/oak-remote/src/main/java/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryFilters.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryId.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCommitException.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCredentials.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteLoginException.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteQueryParseException.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRepository.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResult.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResults.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRevision.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteSession.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTree.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTreeFilters.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteValue.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/AddContentRemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/AggregateContentRemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/BasicContentRemoteCredentials.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteBinaries.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteBinaryId.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteCredentials.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteInputStream.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteRepository.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteResult.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteResults.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteRevision.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteRevisions.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteSession.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteTree.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/CopyContentRemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/MoveContentRemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/RemoveContentRemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/SetContentRemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/SetPropertyHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/content/UnsetContentRemoteOperation.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/filter/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/filter/Filter.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/filter/Filters.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/RemoteHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/RemoteServlet.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/AuthenticationWrapperHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/GetBinaryHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/GetLastRevisionHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/GetLastTreeHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/GetRevisionTreeHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/GetTreeHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/Handler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/Handlers.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/HeadBinaryHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/HeadLastTreeHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/HeadRevisionTreeHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/HeadTreeHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/NotFoundHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/PatchLastRevisionHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/PatchRevisionHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/PatchSpecificRevisionHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/PostBinaryHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/RemoteValues.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/ResponseUtils.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/SearchLastRevisionHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/SearchRevisionHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/SearchSpecificRevisionHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/handler/UnauthorizedHandler.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/matcher/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/matcher/AllMatcher.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/matcher/Matcher.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/matcher/Matchers.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/matcher/MethodMatcher.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/http/matcher/PathMatcher.java
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/osgi/
    jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/osgi/RemoteServletRegistration.java
    jackrabbit/oak/trunk/oak-remote/src/test/
    jackrabbit/oak/trunk/oak-remote/src/test/java/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/AddContentRemoteOperationTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteRepositoryTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteResultTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteResultsTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteSessionTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/ContentRemoteTreeTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/CopyContentRemoteOperationTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/MoveContentRemoteOperationTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/RemoveContentRemoteOperationTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/SetContentRemoteOperationTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/content/UnsetContentRemoteOperationTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/filter/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/filter/FilterTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/filter/FiltersTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/handler/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/handler/RemoteServer.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/handler/RemoteServerIT.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/matcher/
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/matcher/AllMatcherTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/matcher/MatchersTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/matcher/MethodMatcherTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/java/org/apache/jackrabbit/oak/remote/http/matcher/PathMatcherTest.java
    jackrabbit/oak/trunk/oak-remote/src/test/resources/
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeBinaryProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeBooleanProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeDateProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeDecimalProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeDoubleProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeLongProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiBinaryProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiBooleanProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiDateProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiDecimalProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiDoubleProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiLongProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiNameProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiPathProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiReferenceProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiStringProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiUriProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeMultiWeakReferenceProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeNameProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodePathProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeReferenceProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeStringProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeUriProperty.json
    jackrabbit/oak/trunk/oak-remote/src/test/resources/org/apache/jackrabbit/oak/remote/http/handler/addNodeWeakReferenceProperty.json
Modified:
    jackrabbit/oak/trunk/oak-run/pom.xml
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
    jackrabbit/oak/trunk/pom.xml

Added: jackrabbit/oak/trunk/oak-remote/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/pom.xml?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/pom.xml (added)
+++ jackrabbit/oak/trunk/oak-remote/pom.xml Thu Jun 11 12:09:15 2015
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.jackrabbit</groupId>
+        <artifactId>oak-parent</artifactId>
+        <version>1.4-SNAPSHOT</version>
+        <relativePath>../oak-parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>oak-remote</artifactId>
+    <name>Oak Remote API</name>
+    <packaging>bundle</packaging>
+
+    <properties>
+        <fixtures>MEMORY_NS,SEGMENT_MK</fixtures>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>2.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-core</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-jcr</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-commons</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr-commons</artifactId>
+            <version>2.9.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>2.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>2.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>3.0.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-server</artifactId>
+            <version>8.1.10.v20130312</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-servlet</artifactId>
+            <version>8.1.10.v20130312</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest-core</artifactId>
+            <version>1.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.10.19</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.mashape.unirest</groupId>
+            <artifactId>unirest-java</artifactId>
+            <version>1.3.27</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-core</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-commons</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mongodb</groupId>
+            <artifactId>mongo-java-driver</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-nop</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <version>1.9.10</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <version>2.18.1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>integration-test</goal>
+                            <goal>verify</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Export-Package/>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryFilters.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryFilters.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryFilters.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryFilters.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,43 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * Represents a set of filters that can be applied when a binary object is read
+ * from the repository.
+ */
+public class RemoteBinaryFilters {
+
+    /**
+     * Return the starting offset into the binary object. This method returns
+     * {@code 0} by default, meaning that the binary object should be read from
+     * the beginning.
+     */
+    public long getStart() {
+        return 0;
+    }
+
+    /**
+     * Return the number of bytes to read. This method returns {@code -1} by
+     * default, meaning that the binary object should be read until the end.
+     */
+    public long getCount() {
+        return -1;
+    }
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryId.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryId.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryId.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteBinaryId.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,37 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * Represents the identifier of a binary object.
+ * <p/>
+ * Binary objects stored in the repository are immutable. The same binary ID is
+ * guaranteed to return the same binary object over time.
+ */
+public interface RemoteBinaryId {
+
+    /**
+     * Returns a string representation of the binary ID. This representation can
+     * be used as a reference by an external system and converted to a {@code
+     * RemoteBinaryId} object using {@link RemoteSession#readBinaryId(String)}.
+     *
+     * @return A string representation of the binary ID.
+     */
+    String asString();
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCommitException.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCommitException.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCommitException.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCommitException.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,41 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * Represents an error condition caused from a set of changes that can't be
+ * committed into the repository.
+ */
+public class RemoteCommitException extends Exception {
+
+    public RemoteCommitException() {
+    }
+
+    public RemoteCommitException(String s) {
+        super(s);
+    }
+
+    public RemoteCommitException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+
+    public RemoteCommitException(Throwable throwable) {
+        super(throwable);
+    }
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCredentials.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCredentials.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCredentials.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteCredentials.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,35 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * This interface is a marker interface to be used to represent both an
+ * authentication strategy and the information to enable that authentication
+ * strategy.
+ * <p/>
+ * In example, a {@code RemoteCredentials} object created to represent an
+ * authentication strategy based on user name and password, may encapsulate the
+ * user name and password to enable this authentication strategy when a session
+ * to the repository is created.
+ * <p/>
+ * To create instances of this interface, take a look at the methods defined in
+ * {@link RemoteRepository}.
+ */
+public interface RemoteCredentials {
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteLoginException.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteLoginException.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteLoginException.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteLoginException.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,40 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * Represents an error condition generated by an unsuccessful login.
+ */
+public class RemoteLoginException extends Exception {
+
+    public RemoteLoginException() {
+    }
+
+    public RemoteLoginException(String s) {
+        super(s);
+    }
+
+    public RemoteLoginException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+
+    public RemoteLoginException(Throwable throwable) {
+        super(throwable);
+    }
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteOperation.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteOperation.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteOperation.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,30 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * An operation to modify content inside the repository.
+ * <p/>
+ * This is just a marker interface. Factory methods for {@code RemoteOperation}
+ * instances are found in {@link RemoteSession}. The interface doesn't currently
+ * expose any method, as its instances are supposed to be consumed by the same
+ * {@code RemoteSession} (or by another instance of the same implementation)
+ * that created them.
+ */
+public interface RemoteOperation {
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteQueryParseException.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteQueryParseException.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteQueryParseException.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteQueryParseException.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,40 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * An error thrown if a query can't be correctly parsed.
+ */
+public class RemoteQueryParseException extends Exception {
+
+    public RemoteQueryParseException() {
+    }
+
+    public RemoteQueryParseException(String s) {
+        super(s);
+    }
+
+    public RemoteQueryParseException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+
+    public RemoteQueryParseException(Throwable throwable) {
+        super(throwable);
+    }
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRepository.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRepository.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRepository.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,70 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+import java.util.Set;
+
+/**
+ * The remote interface exposed by a repository.
+ * <p/>
+ * Most methods require authentication to be used. As such, a client of this
+ * interface is required to create an instance of {@code RemoteCredentials} and
+ * use this instance to login into the repository and obtain a {@code
+ * RemoteSession} object.
+ */
+public interface RemoteRepository {
+
+    /**
+     * Create a {@code RemoteCredentials} object representing an authentication
+     * strategy based on a user name and a password. This kind of credentials
+     * delegates authentication to the repository, using a user identified by
+     * the user name and password provided to this method.
+     *
+     * @param user     User name.
+     * @param password Password.
+     * @return A {@code RemoteCredentials} object representing an authentication
+     * strategy based on a user name and password.
+     */
+    RemoteCredentials createBasicCredentials(String user, char[] password);
+
+    /**
+     * Create a {@code RemoteCredentials} object representing an impersonation
+     * authentication strategy. If this authentication strategy is used, the
+     * repository will not make any attempt to perform authentication. It will
+     * instead trust the information provided by the {@code RemoteCredentials}
+     * and will create a {@code RemoteSession} bound to the principals specified
+     * to this method.
+     *
+     * @param principals The set of principals to impersonate into.
+     * @return A {@code RemoteCredentials} object representing an authentication
+     * strategy based on impersonation.
+     */
+    RemoteCredentials createImpersonationCredentials(Set<String> principals);
+
+    /**
+     * Create a remote session exposing some repository operations.
+     *
+     * @param credentials An object representing an authentication strategy to
+     *                    be used when invoking repository operations.
+     * @return An instance of a remote session to invoke repository operations.
+     * @throws RemoteLoginException if it was not possible to authenticate the
+     *                              given credentials.
+     */
+    RemoteSession login(RemoteCredentials credentials) throws RemoteLoginException;
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResult.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResult.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResult.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResult.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,41 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * A single search result.
+ */
+public interface RemoteResult {
+
+    /**
+     * The value attached to this search result at the specified column.
+     *
+     * @param column Name of the column.
+     * @return An instance of {@code RemoteValue}.
+     */
+    RemoteValue getColumnValue(String column);
+
+    /**
+     * Read the path of the node associated with the specified selector.
+     *
+     * @param selector The name of the selector.
+     * @return A node path.
+     */
+    String getSelectorPath(String selector);
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResults.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResults.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResults.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteResults.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,51 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * A collection of search results.
+ */
+public interface RemoteResults extends Iterable<RemoteResult> {
+
+    /**
+     * If available, it returns the number of results that the query is able to
+     * return. The number of results is independent of the offset and limit
+     * options used when executing the query.
+     *
+     * @return The total number of results, or -1 if this information is not
+     * available.
+     */
+    long getTotal();
+
+    /**
+     * The name of the columns contained in the search result.
+     *
+     * @return An instance of {@code Iterable}, where each element represents
+     * the name of a column in the search result.
+     */
+    Iterable<String> getColumns();
+
+    /**
+     * The name of the selectors involved in the query.
+     *
+     * @return An instance of {@code Iterable}, where each element represents
+     * the name of a selector involved in the query.
+     */
+    Iterable<String> getSelectors();
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRevision.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRevision.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRevision.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteRevision.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,42 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+/**
+ * A repository revision represents an immutable state of the repository.
+ * <p/>
+ * Having a revision allows you to perform repeatable reads, because it is
+ * assured that the state referenced by the revision is immutable.
+ * <p/>
+ * The revision also allows the system to reference a known state of the
+ * repository when changes are committed. Since a revision references an
+ * immutable state, committing some changes will create a new state of the
+ * repository that will be referenced by a new revision.
+ */
+public interface RemoteRevision {
+
+    /**
+     * Returns a string representation of the revision. This representation can
+     * be used as a reference by an external system and converted to a {@code
+     * RemoteRevision} object using {@link RemoteSession#readRevision(String)}.
+     *
+     * @return A string representation of the revision.
+     */
+    String asString();
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteSession.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteSession.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteSession.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,227 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Collection of operations available on a remote repository once the user
+ * correctly logged in.
+ * <p/>
+ * Operations working on pure content, like reading a tree or committing
+ * changes, requires a revision. A revision represents a snapshot of the
+ * repository in a specified point in time. This concept enables repeatable
+ * reads and consistent writes.
+ * <p/>
+ * When binary data is involved, this interface exposes methods to read and
+ * write arbitrary binary data from and to the repository. A binary data is
+ * considered an immutable collection of bytes that can be referenced by an
+ * identifier.
+ */
+public interface RemoteSession {
+
+    /**
+     * Read the latest revision in the repository.
+     * <p/>
+     * This operation is always meant to succeed, because the repository will
+     * always have an initial revision to return to the caller.
+     *
+     * @return The latest revision in the repository.
+     */
+    RemoteRevision readLastRevision();
+
+    /**
+     * Read a revision given a string representation of the revision itself.
+     * <p/>
+     * This operation may fail for a number of reasons. In example, the string
+     * passed to this method is not a valid revision, or this string represents
+     * a revision that was valid in the past but it is no more valid.
+     *
+     * @param revision The string representation of the revision.
+     * @return The revision represented by the string passed to this method, or
+     * {@code null} if the string representation is invalid.
+     */
+    RemoteRevision readRevision(String revision);
+
+    /**
+     * Read a sub-tree from the repository at the given revision. Some filters
+     * may be applied to the tree to avoid reading unwanted information.
+     *
+     * @param revision The revision representing the state of the repository to
+     *                 read from.
+     * @param path     The path of the root of the subtree to read.
+     * @param filters  Filters to apply to the returned tree.
+     * @return The tree requested by the given path, filtered according to the
+     * provided filters. The method can return {@code null} if the root of the
+     * tree is not found in the repository for the given revision.
+     */
+    RemoteTree readTree(RemoteRevision revision, String path, RemoteTreeFilters filters);
+
+    /**
+     * Create an operation to represent the addition of a new node in the
+     * repository.
+     *
+     * @param path       Path of the new node to create.
+     * @param properties Initial set of properties attached to the new node.
+     * @return An operation representing the addition of a new node.
+     */
+    RemoteOperation createAddOperation(String path, Map<String, RemoteValue> properties);
+
+    /**
+     * Create an operation representing the removal of an existing node from the
+     * repository.
+     *
+     * @param path Path of the node to remove.
+     * @return An operation representing the removal of an existing node.
+     */
+    RemoteOperation createRemoveOperation(String path);
+
+    /**
+     * Create an operation representing the creation or modification of a
+     * property of an existing node.
+     *
+     * @param path  Path of the node where the property is or will be attached
+     *              to.
+     * @param name  Name of the property to set.
+     * @param value Value of the property.
+     * @return An operation representing the creation or modification of a
+     * property of an existing node.
+     */
+    RemoteOperation createSetOperation(String path, String name, RemoteValue value);
+
+    /**
+     * Create an operation to represent the removal of an existing property from
+     * an existing node in the repository.
+     *
+     * @param path Path of the node where the property is attached to.
+     * @param name Name of the property to remove.
+     * @return An operation representing the removal of a property.
+     */
+    RemoteOperation createUnsetOperation(String path, String name);
+
+    /**
+     * Create an operation to represent the copy of a subtree into another
+     * location into the repository.
+     *
+     * @param source Path of the root of the subtree to copy.
+     * @param target Path where the subtree should be copied to.
+     * @return An operation representing a copy of a subtree.
+     */
+    RemoteOperation createCopyOperation(String source, String target);
+
+    /**
+     * Create an operation to represent the move of a subtree into another
+     * location into the repository.
+     *
+     * @param source Path of the root of the source subtree to move.
+     * @param target Path where the subtree should be moved to.
+     * @return An operation representing a move of a subtree.
+     */
+    RemoteOperation createMoveOperation(String source, String target);
+
+    /**
+     * Create an operation that represents the aggregation of multiple, simpler
+     * operations. The aggregated operations are applied in the same sequence
+     * provided by this method.
+     *
+     * @param operations Sequence of operations to aggregate.
+     * @return An operation that, when executed, will execute the provided
+     * operations in the provided sequence.
+     */
+    RemoteOperation createAggregateOperation(List<RemoteOperation> operations);
+
+    /**
+     * Commit some changes to the repository. The changes are represented by an
+     * operation. The operation will be applied on the repository state
+     * represented by the given revision.
+     *
+     * @param revision  Revision where the changes should be applied to.
+     * @param operation Operation to change the state of the repository.
+     * @return A new revision representing the new state of the repository where
+     * the changes are applied.
+     * @throws RemoteCommitException if the provided operation can't be
+     *                               performed on the provided repository
+     *                               state.
+     */
+    RemoteRevision commit(RemoteRevision revision, RemoteOperation operation) throws RemoteCommitException;
+
+    /**
+     * Read a binary ID given a string representation of the binary ID itself.
+     * <p/>
+     * This operations may fail for a number of reasons. In example, the string
+     * doesn't represent a valid binary ID, or the string represents a binary ID
+     * that was valid in the past but is no more valid.
+     *
+     * @param binaryId String representation of the binary ID.
+     * @return The binary ID read from the repository. This method may return
+     * {@code null} if the string representation of the binary ID is not valid.
+     */
+    RemoteBinaryId readBinaryId(String binaryId);
+
+    /**
+     * Read a binary object from the repository according to the given filters.
+     * <p/>
+     * In the case of a binary object, filters are really simple. At most, it is
+     * possible to read just a portion of the binary object instead of reading
+     * it in its entirety.
+     *
+     * @param binaryId Binary ID referring to the binary object to read.
+     * @param filters  Filters to apply to the returned binary object.
+     * @return A stream representing the filtered content of the binary object.
+     */
+    InputStream readBinary(RemoteBinaryId binaryId, RemoteBinaryFilters filters);
+
+    /**
+     * Read the length of a binary object from the repository.
+     *
+     * @param binaryId Binary ID referring to the binary object whose length
+     *                 should be read.
+     * @return The length of the binary object.
+     */
+    long readBinaryLength(RemoteBinaryId binaryId);
+
+    /**
+     * Write a binary object into the repository and return a binary ID
+     * referencing to it.
+     *
+     * @param stream Stream representing the binary object to write.
+     * @return Binary ID referencing the binary object written in the
+     * repository.
+     */
+    RemoteBinaryId writeBinary(InputStream stream);
+
+    /**
+     * Performs a search in the content and returns a set of search results.
+     *
+     * @param revision The revision that should be used when searching the
+     *                 content.
+     * @param query    The query. It may contain placeholders that are to be
+     *                 substituted with the actual parameters.
+     * @param language The language the query is written in. It identifies the
+     *                 syntax of the query.
+     * @param offset   How many rows to skip when returning the results.
+     * @param limit    How many results to return.
+     * @return Search results.
+     * @throws RemoteQueryParseException if the query can't be correctly
+     *                                   parsed.
+     */
+    RemoteResults search(RemoteRevision revision, String query, String language, long offset, long limit) throws RemoteQueryParseException;
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTree.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTree.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTree.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,74 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+import java.util.Map;
+
+/**
+ * This interface is a recursive data structure representing a view on a
+ * repository tree.
+ * <p/>
+ * The purpose of the remote tree is not to represent exactly the content as
+ * stored in the repository, but to provide a view on that content fulfilling
+ * the filtering options provided by the client when the tree was accessed.
+ */
+public interface RemoteTree {
+
+    /**
+     * Read the properties associated to the root of this remote tree. The root
+     * of this remote tree is represented by the instance of {@code RemoteTree}
+     * this method is invoked on.
+     *
+     * @return the properties associated to the root of this remote tree.
+     */
+    Map<String, RemoteValue> getProperties();
+
+    /**
+     * Read the children associated to the root of this remote tree. The root of
+     * this remote tree is represented by the instance of {@code RemoteTree}
+     * this method is invoked on. The children of this remote tree are
+     * themselves remote trees.
+     * <p/>
+     * The remote tree may be truncated at some point (e.g. to avoid very deep
+     * remote trees to be returned), and this is the reason why the values of
+     * this {@code Map} can be {@code null}. When a {@code null} value is met,
+     * the consumer of this interface must assume that there is another subtree
+     * rooted under the corresponding key, but it is not returned to fulfill the
+     * filtering options provided when this tree was read.
+     *
+     * @return The children associated to the root of this remote tree.
+     */
+    Map<String, RemoteTree> getChildren();
+
+    /**
+     * Return a flag to indicate that this remote tree actually has more
+     * children than the one returned by {@link #getChildren()}.
+     * <p/>
+     * This flag is important when the repository tree is read using very strict
+     * filtering options regarding the maximum number of children to return. If
+     * this method returns {@code true}, a consumer of this interface must
+     * assume that there are more children than the one attached to the root of
+     * this tree. They could be retrieved by varying the relevant filtering
+     * options and performing another read for this subtree.
+     *
+     * @return {@true} if this remote tree is not exposing the full set of
+     * children as stored in the repository, {@code false} otherwise.
+     */
+    boolean hasMoreChildren();
+
+}

Added: jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTreeFilters.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTreeFilters.java?rev=1684861&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTreeFilters.java (added)
+++ jackrabbit/oak/trunk/oak-remote/src/main/java/org/apache/jackrabbit/oak/remote/RemoteTreeFilters.java Thu Jun 11 12:09:15 2015
@@ -0,0 +1,85 @@
+/*
+ * 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.jackrabbit.oak.remote;
+
+import java.util.Set;
+
+import static com.google.common.collect.Sets.newHashSet;
+
+/**
+ * Represents a set of filters that can be applied when a subtree is read from
+ * the repository.
+ */
+public class RemoteTreeFilters {
+
+    /**
+     * Return the depth of the tree to read. This method returns {@code 0} by
+     * default, meaning that only the root of the subtree will be returned. The
+     * default value makes read operation for a subtree look like the read
+     * operation for a single node.
+     */
+    public int getDepth() {
+        return 0;
+    }
+
+    /**
+     * Return the property filters. This method returns {@code {"*"}} by
+     * default, meaning that every property will be returned for every node
+     * included in the subtree.
+     */
+    public Set<String> getPropertyFilters() {
+        return newHashSet("*");
+    }
+
+    /**
+     * Return the node filters. This method returns a value of {@code {"*"}} by
+     * default, meaning that every descendant node of the root of the tree wil
+     * be returned.
+     */
+    public Set<String> getNodeFilters() {
+        return newHashSet("*");
+    }
+
+    /**
+     * Return the binary threshold. This method returns {@code 0} by default,
+     * meaning that by default binary properties will be returned as references
+     * to binary objects, instead of being returned as proper binary objects.
+     */
+    public long getBinaryThreshold() {
+        return 0;
+    }
+
+    /**
+     * Return the start index for children. This method returns {@code 0} by
+     * default, meaning that children will be read from the beginning when
+     * reading the root node and every descendant.
+     */
+    public int getChildrenStart() {
+        return 0;
+    }
+
+    /**
+     * Return the maximum number of children to return. This method returns
+     * {@code -1} by default, meaning that every children will be returned when
+     * reading the root node and every descendant.
+     */
+    public int getChildrenCount() {
+        return -1;
+    }
+
+}