org.apache.sling.resourceresolver.impl.tree
Class ProviderHandler

java.lang.Object
  extended by org.apache.sling.resourceresolver.impl.tree.ProviderHandler
All Implemented Interfaces:
Comparable<ProviderHandler>
Direct Known Subclasses:
ResourceProviderFactoryHandler, ResourceProviderHandler

public abstract class ProviderHandler
extends Object
implements Comparable<ProviderHandler>

The provider handler is the common base class for the ResourceProviderHandler and the ResourceProviderFactoryHandler.


Constructor Summary
ProviderHandler(Map<String,Object> properties)
          Create a new handler
 
Method Summary
 boolean canCreate(ResourceResolverContext ctx, org.apache.sling.api.resource.ResourceResolver resolver, String path)
           
 boolean canDelete(ResourceResolverContext ctx, org.apache.sling.api.resource.Resource resource)
           
 int compareTo(ProviderHandler other)
           
 String getName()
          Return a name of the resource provider/factory.
 Map<String,Object> getProperties()
          Return the service properties.
protected  Iterator<org.apache.sling.api.resource.Resource> getReadableChildrenIterator(ResourceResolverContext ctx, Iterator<org.apache.sling.api.resource.Resource> childrenIterator)
          applies resource access security if configured
protected  org.apache.sling.api.resource.Resource getReadableResource(ResourceResolverContext ctx, org.apache.sling.api.resource.Resource resource)
          applies resource access security if configured
abstract  org.apache.sling.api.resource.Resource getResource(ResourceResolverContext ctx, org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)
           
abstract  org.apache.sling.api.resource.ResourceProvider getResourceProvider(ResourceResolverContext ctx)
          Return the resource provider.
 String[] getRoots()
          Return a sorted array of roots for this provider.
 Long getServiceId()
          Return the service id.
abstract  Iterator<org.apache.sling.api.resource.Resource> listChildren(ResourceResolverContext ctx, org.apache.sling.api.resource.Resource parent)
           
 boolean ownsRoots()
          Does this provider own the roots?
 boolean supportsQueryLanguages(String language)
          Check if the resource provider supports the language.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderHandler

public ProviderHandler(Map<String,Object> properties)
Create a new handler

Method Detail

canCreate

public boolean canCreate(ResourceResolverContext ctx,
                         org.apache.sling.api.resource.ResourceResolver resolver,
                         String path)

canDelete

public boolean canDelete(ResourceResolverContext ctx,
                         org.apache.sling.api.resource.Resource resource)

getReadableResource

protected org.apache.sling.api.resource.Resource getReadableResource(ResourceResolverContext ctx,
                                                                     org.apache.sling.api.resource.Resource resource)
applies resource access security if configured


getReadableChildrenIterator

protected Iterator<org.apache.sling.api.resource.Resource> getReadableChildrenIterator(ResourceResolverContext ctx,
                                                                                       Iterator<org.apache.sling.api.resource.Resource> childrenIterator)
applies resource access security if configured


getProperties

public Map<String,Object> getProperties()
Return the service properties.


getServiceId

public Long getServiceId()
Return the service id.


ownsRoots

public boolean ownsRoots()
Does this provider own the roots?


getRoots

public String[] getRoots()
Return a sorted array of roots for this provider. If no roots are configured, this will return null

Returns:
The array of roots or null

supportsQueryLanguages

public boolean supportsQueryLanguages(String language)
Check if the resource provider supports the language.


compareTo

public int compareTo(ProviderHandler other)
Specified by:
compareTo in interface Comparable<ProviderHandler>
See Also:
Comparable.compareTo(java.lang.Object)

getResource

public abstract org.apache.sling.api.resource.Resource getResource(ResourceResolverContext ctx,
                                                                   org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                                                   String path)
See Also:
ResourceProvider.getResource(ResourceResolver, String)

listChildren

public abstract Iterator<org.apache.sling.api.resource.Resource> listChildren(ResourceResolverContext ctx,
                                                                              org.apache.sling.api.resource.Resource parent)
See Also:
ResourceProvider.listChildren(Resource)

getResourceProvider

public abstract org.apache.sling.api.resource.ResourceProvider getResourceProvider(ResourceResolverContext ctx)
Return the resource provider.


getName

public String getName()
Return a name of the resource provider/factory.



Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.