You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2015/05/05 12:22:58 UTC
svn commit: r1677773 - in
/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource:
observation/ provider/ query/
Author: cziegeler
Date: Tue May 5 10:22:58 2015
New Revision: 1677773
URL: http://svn.apache.org/r1677773
Log:
First draft of a new provider api, new observation api and new query api
Added:
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/package-info.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/AbstractResourceProvider.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/QueryProvider.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResolveContext.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResourceProvider.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/PropertyBuilder.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/Query.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryBuilder.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java (with props)
sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/package-info.java (with props)
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java Tue May 5 10:22:58 2015
@@ -0,0 +1,26 @@
+/*
+ * 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.sling.api.resource.observation;
+
+import aQute.bnd.annotation.ConsumerType;
+
+@ConsumerType
+public class ResourceListener {
+
+}
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/ResourceListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/package-info.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/package-info.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/package-info.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/package-info.java Tue May 5 10:22:58 2015
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+@Version("1.0.0")
+package org.apache.sling.api.resource.observation;
+
+import aQute.bnd.annotation.Version;
+
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/package-info.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/observation/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/AbstractResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/AbstractResourceProvider.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/AbstractResourceProvider.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/AbstractResourceProvider.java Tue May 5 10:22:58 2015
@@ -0,0 +1,151 @@
+/*
+ * 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.sling.api.resource.provider;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.PersistenceException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceProviderFactory;
+import org.apache.sling.api.resource.ResourceResolver;
+
+import aQute.bnd.annotation.ProviderType;
+
+/**
+ * API for providers of resources. Used by the {@link ResourceResolver} to
+ * transparently access resources from different locations such as a JCR
+ * repository (the default) or OSGi bundles.
+ * <p>
+ * This interface is intended to be implemented by providers of resource
+ * instances on behalf of the {@link ResourceResolver}. It
+ * is not intended to be used by client applications directly. A resource
+ * provider can either directly implement this service interface, e.g.
+ * when no user authentication is provided (like for bundle resources)
+ * or a {@link ResourceProviderFactory} service can be implemented which
+ * upon successful authentication returns a resource provider with the
+ * given user credentials.
+ */
+@ProviderType
+public abstract class AbstractResourceProvider<T> implements ResourceProvider<T> {
+
+ @Override
+ public T authenticate(Map<String, Object> authenticationInfo)
+ throws LoginException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void logout(ResolveContext<T> ctx) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void refresh() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean isLive(ResolveContext<T> ctx) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public Resource getParent(ResolveContext<T> ctx, Resource child) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Resource getResource(ResolveContext<T> ctx, String path) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Iterator<Resource> listChildren(ResolveContext<T> ctx,
+ Resource parent) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Collection<String> getAttributeNames(ResolveContext<T> ctx) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getAttribute(ResolveContext<T> ctx, String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Resource create(ResolveContext<T> ctx, String path,
+ Map<String, Object> properties) throws PersistenceException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void delete(ResolveContext<T> ctx, Resource resource)
+ throws PersistenceException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void revert(ResolveContext<T> ctx) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void commit(ResolveContext<T> ctx) throws PersistenceException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean hasChanges(ResolveContext<T> ctx) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public QueryProvider<T> getQueryProvider() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public <AdapterType> AdapterType adaptTo(ResolveContext<T> ctx, Class<AdapterType> type) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/AbstractResourceProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/AbstractResourceProvider.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/AbstractResourceProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java Tue May 5 10:22:58 2015
@@ -0,0 +1,57 @@
+/*
+ * 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.sling.api.resource.provider;
+
+import javax.annotation.Nonnull;
+
+import aQute.bnd.annotation.ProviderType;
+
+/**
+ */
+@ProviderType
+public interface ObservationHandler {
+
+ void reportChanges(@Nonnull ResourceChange... changes);
+
+ /**
+ * TODO move to separate class
+ */
+ public class ResourceChange {
+
+ public static ResourceChange resourceChanged(String path,
+ String userId,
+ String resourceType) {
+ // TODO props;
+ return null;
+ }
+
+ public static ResourceChange resourceAdded(String path,
+ String userId,
+ String resourceType) {
+ // TODO props;
+ return null;
+ }
+ public static ResourceChange resourceRemoved(String path,
+ String userId,
+ String resourceType) {
+ // TODO props;
+ return null;
+ }
+ }
+}
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ObservationHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/QueryProvider.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/QueryProvider.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/QueryProvider.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/QueryProvider.java Tue May 5 10:22:58 2015
@@ -0,0 +1,38 @@
+/*
+ * 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.sling.api.resource.provider;
+
+import java.util.Iterator;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.query.Query;
+import org.apache.sling.api.resource.query.QueryManager.QueryInstruction;
+
+import aQute.bnd.annotation.ConsumerType;
+
+@ConsumerType
+public interface QueryProvider <T> {
+
+ @CheckForNull Iterator<Resource> find(@Nonnull ResolveContext<T> ctx,
+ @Nonnull Query q,
+ @CheckForNull QueryInstruction qi);
+}
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/QueryProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/QueryProvider.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/QueryProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResolveContext.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResolveContext.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResolveContext.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResolveContext.java Tue May 5 10:22:58 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.sling.api.resource.provider;
+
+import java.util.Map;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.ResourceResolver;
+
+import aQute.bnd.annotation.ProviderType;
+
+/**
+ */
+@ProviderType
+public interface ResolveContext<T> {
+
+ @Nonnull ResourceResolver getResourceResolver();
+
+ @CheckForNull Map<String, String> getParameters();
+
+ @CheckForNull T getProviderState();
+}
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResolveContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResolveContext.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResolveContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResourceProvider.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResourceProvider.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResourceProvider.java Tue May 5 10:22:58 2015
@@ -0,0 +1,216 @@
+/*
+ * 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.sling.api.resource.provider;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.PersistenceException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceProviderFactory;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceResolverFactory;
+
+import aQute.bnd.annotation.ConsumerType;
+
+/**
+ * API for providers of resources. Used by the {@link ResourceResolver} to
+ * transparently access resources from different locations such as a JCR
+ * repository (the default) or OSGi bundles.
+ * <p>
+ * This interface is intended to be implemented by providers of resource
+ * instances on behalf of the {@link ResourceResolver}. It
+ * is not intended to be used by client applications directly. A resource
+ * provider can either directly implement this service interface, e.g.
+ * when no user authentication is provided (like for bundle resources)
+ * or a {@link ResourceProviderFactory} service can be implemented which
+ * upon successful authentication returns a resource provider with the
+ * given user credentials.
+ */
+@ConsumerType
+public interface ResourceProvider<T> {
+
+ /**
+ * The name of the service registration property containing the root path
+ * of the resources provided by this provider (value is "provider.root").
+ * If this property is missing, empty or invalid, the provider is ignored.
+ * (value is "provider.root")
+ */
+ String PROPERTY_ROOT = "provider.root";
+
+ /**
+ * The name of the service registration property containing a boolean
+ * flag indicating if the ResourceAccessSecurity service should be used for
+ * this provider or not. ResourceProvider implementations are encouraged
+ * to use the ResourceAccessSecurity service for access control unless
+ * the underlying storage already provides it.
+ * The default for this value is <code>false</code>.
+ * (value is "provider.useResourceAccessSecurity")
+ */
+ String PROPERTY_USE_RESOURCE_ACCESS_SECURITY = "provider.useResourceAccessSecurity";
+
+ /**
+ * A required resource provider factory is accessed directly when a new
+ * resource resolver is created. Only if authentication against all required
+ * resource provider factories is successful, a resource resolver is created
+ * by the resource resolver factory. Boolean service property, default value
+ * is <code>false</true>
+ */
+ String PROPERTY_REQUIRED = "provider.required";
+
+ /**
+ * The authentication information property referring to the bundle
+ * providing a service for which a resource provider is to be retrieved. If
+ * this property is provided, the
+ * {@link ResourceResolverFactory#SUBSERVICE} property may also be
+ * present.
+ * <p>
+ * {@link ResourceResolverFactory} implementations must provide this
+ * property if their implementation of the
+ * {@link ResourceResolverFactory#getServiceResourceResolver(Map)} method
+ * use a resource provider factory.
+ * <p>
+ * The type of this property, if present, is
+ * <code>org.osgi.framework.Bundle</code>.
+ */
+ String AUTH_SERVICE_BUNDLE = "sling.service.bundle";
+
+ @Nonnull T authenticate(Map<String, Object> authenticationInfo) throws LoginException;
+
+ /**
+ * Close the resource provider.
+ * Once the resource provider is not used anymore, it should be closed with
+ * this method.
+ */
+ void logout(@Nonnull ResolveContext<T> ctx);
+
+ /**
+ * The provider is updated to reflect the latest state.
+ * Resources which have changes pending are not discarded.
+ */
+ void refresh();
+
+ /**
+ * Returns <code>true</code> if this resource provider has not been closed
+ * yet and can still be used.
+ * <p>
+ * This method will never throw an exception
+ * even after the resource provider has been closed
+ *
+ * @return <code>true</code> if the resource provider has not been closed
+ * yet and is still active.. Once the resource provider has been closed
+ * or is not active anymore, this method returns <code>false</code>.
+ */
+ boolean isLive(@Nonnull ResolveContext<T> ctx);
+
+ @CheckForNull Resource getParent(@Nonnull ResolveContext<T> ctx, @Nonnull Resource child);
+
+ @CheckForNull Resource getResource(@Nonnull ResolveContext<T> ctx, @Nonnull String path);
+
+ @CheckForNull Iterator<Resource> listChildren(@Nonnull ResolveContext<T> ctx, @Nonnull Resource parent);
+
+ /**
+ * Returns a collection of attribute names whose value can be retrieved
+ * calling the {@link #getAttribute(ResourceResolver, String)} method.
+ *
+ * @return A collection of attribute names or <code>null</code>
+ * @throws IllegalStateException if this resource provider has already been
+ * closed.
+ */
+ Collection<String> getAttributeNames(@Nonnull ResolveContext<T> ctx);
+
+ /**
+ * Returns the value of the given resource provider attribute or <code>null</code>
+ * if the attribute is not set or not visible (as e.g. security
+ * sensitive attributes).
+ *
+ * @param name
+ * The name of the attribute to access
+ * @return The value of the attribute or <code>null</code> if the attribute
+ * is not set or not accessible.
+ * @throws IllegalStateException
+ * if this resource provider has already been closed.
+ */
+ Object getAttribute(@Nonnull ResolveContext<T> ctx, @Nonnull String name);
+
+ /**
+ * Create a new resource at the given path.
+ * The new resource is put into the transient space of this provider
+ * until {@link #commit(ResourceResolver)} is called.
+ *
+ * A resource provider should value {@link ResourceResolver#PROPERTY_RESOURCE_TYPE}
+ * to set the resource type of a resource.
+ *
+ * @param resolver The current resource resolver.
+ * @param path The resource path.
+ * @param properties Optional properties
+ * @return The new resource.
+ *
+ * @throws PersistenceException If anything fails
+ */
+ Resource create(@Nonnull ResolveContext<T> ctx, String path, Map<String, Object> properties)
+ throws PersistenceException;
+
+ /**
+ * Delete the resource at the given path.
+ * This change is kept in the transient space of this provider
+ * until {@link #commit(ResourceResolver)} is called.
+ *
+ * @param resolver The current resource resolver.
+ * @param path The resource path.
+ *
+ * @throws PersistenceException If anything fails
+ */
+ void delete(@Nonnull ResolveContext<T> ctx, Resource resource)
+ throws PersistenceException;
+
+ /**
+ * Revert all transient changes: create, delete and updates.
+ *
+ * @param resolver The current resource resolver.
+ */
+ void revert(@Nonnull ResolveContext<T> ctx);
+
+ /**
+ * Commit all transient changes: create, delete and updates
+ *
+ * @param resolver The current resource resolver.
+ *
+ * @throws PersistenceException If anything fails
+ */
+ void commit(@Nonnull ResolveContext<T> ctx)
+ throws PersistenceException;
+
+ /**
+ * Are there any transient changes?
+ *
+ * @param resolver The current resource resolver.
+ */
+ boolean hasChanges(@Nonnull ResolveContext<T> ctx);
+
+ @CheckForNull QueryProvider<T> getQueryProvider();
+
+ @CheckForNull <AdapterType> AdapterType adaptTo(@Nonnull ResolveContext<T> ctx, Class<AdapterType> type);
+
+}
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResourceProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResourceProvider.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/ResourceProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java Tue May 5 10:22:58 2015
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+@Version(1.0.0")
+package org.apache.sling.api.resource.provider;
+
+import aQute.bnd.annotation.Version;
+
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/provider/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/PropertyBuilder.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/PropertyBuilder.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/PropertyBuilder.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/PropertyBuilder.java Tue May 5 10:22:58 2015
@@ -0,0 +1,38 @@
+/*
+ * 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.sling.api.resource.query;
+
+import javax.annotation.Nonnull;
+
+public interface PropertyBuilder {
+
+ @Nonnull QueryBuilder eq(Object value);
+
+ @Nonnull QueryBuilder isGreater(Object value);
+
+ @Nonnull QueryBuilder isGreaterOrEq(Object value);
+
+ @Nonnull QueryBuilder isLess(Object value);
+
+ @Nonnull QueryBuilder isLessOrEq(Object value);
+
+ @Nonnull QueryBuilder approx(Object value);
+
+ @Nonnull QueryBuilder exists();
+}
\ No newline at end of file
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/PropertyBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/PropertyBuilder.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/PropertyBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/Query.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/Query.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/Query.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/Query.java Tue May 5 10:22:58 2015
@@ -0,0 +1,71 @@
+/*
+ * 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.sling.api.resource.query;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
+
+public interface Query {
+
+ public enum PartOperatorType {
+ NONE,
+ AND,
+ OR
+ };
+
+ public enum PropertyOperations {
+ EXISTS,
+ EQ,
+ GT,
+ GT_EG,
+ LT,
+ LT_EG,
+ APPROX
+ };
+
+ public interface PropertyConstraint {
+
+ @Nonnull PropertyOperations getOperation();
+
+ @Nonnull String getName();
+
+ @CheckForNull Object getValue();
+ }
+
+ /**
+ * Unique global id.
+ * The id can be used by implementations to cache the parsed query.
+ * The id is ensured to be the same for two identical queries.
+ * @return A unique global id.
+ */
+ @Nonnull String getId();
+
+ @CheckForNull String[] getPaths();
+
+ @CheckForNull String getIsA();
+
+ boolean isNegative();
+
+ @CheckForNull Query[] getParts();
+
+ @Nonnull PartOperatorType getPartOperatorType();
+
+ @CheckForNull PropertyConstraint[] getPropertyConstraints();
+}
\ No newline at end of file
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/Query.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/Query.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/Query.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryBuilder.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryBuilder.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryBuilder.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryBuilder.java Tue May 5 10:22:58 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.sling.api.resource.query;
+
+import javax.annotation.Nonnull;
+
+
+public interface QueryBuilder {
+
+ @Nonnull QueryBuilder at(@Nonnull String... path);
+
+ @Nonnull QueryBuilder isA(@Nonnull String resourceType);
+
+ @Nonnull PropertyBuilder property(@Nonnull String name);
+
+ @Nonnull Query and(@Nonnull Query q1, @Nonnull Query... q2);
+
+ @Nonnull Query or(@Nonnull Query q1, @Nonnull Query... q2);
+
+ @Nonnull Query not(@Nonnull Query q);
+
+ @Nonnull Query build();
+
+ @Nonnull QueryBuilder sortAscendingBy(String propName);
+
+ @Nonnull QueryBuilder sortDescendingBy(String propName);
+}
\ No newline at end of file
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryBuilder.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java Tue May 5 10:22:58 2015
@@ -0,0 +1,49 @@
+/*
+ * 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.sling.api.resource.query;
+
+import java.util.Iterator;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+
+import aQute.bnd.annotation.ProviderType;
+
+@ProviderType
+public interface QueryManager extends QueryBuilder {
+
+ @Nonnull QueryBuilder create();
+
+ @Nonnull QueryInstruction limit(int n);
+
+ @Nonnull QueryInstruction range(int start, int end);
+
+ @Nonnull Iterator<Resource> find(@Nonnull ResourceResolver resolver,
+ @Nonnull Query q);
+
+ @Nonnull Iterator<Resource> find(@Nonnull ResourceResolver resolver,
+ @Nonnull Query q,
+ @Nonnull QueryInstruction qi);
+
+ public interface QueryInstruction {
+
+ }
+}
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/package-info.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/package-info.java?rev=1677773&view=auto
==============================================================================
--- sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/package-info.java (added)
+++ sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/package-info.java Tue May 5 10:22:58 2015
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+@Version("1.0.0")
+package org.apache.sling.api.resource.query;
+
+import aQute.bnd.annotation.Version;
+
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/package-info.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/whiteboard/cziegeler/api-v3/src/main/java/org/apache/sling/api/resource/query/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain