org.apache.sling.jcr.resource.internal
Class JcrResourceResolverFactoryImpl

java.lang.Object
  extended by org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl
All Implemented Interfaces:
ResourceResolverFactory, JcrResourceResolverFactory

public class JcrResourceResolverFactoryImpl
extends Object
implements JcrResourceResolverFactory, ResourceResolverFactory

The JcrResourceResolverFactoryImpl is the JcrResourceResolverFactory service providing the following functionality:


Nested Class Summary
static class JcrResourceResolverFactoryImpl.ResourcePattern
           
 
Field Summary
static String ALL_WORKSPACES
          Special value which, if passed to listener.workspaces, will have resource events fired for all workspaces.
static String PROP_PATH
           
 
Fields inherited from interface org.apache.sling.api.resource.ResourceResolverFactory
PASSWORD, USER, USER_IMPERSONATION
 
Constructor Summary
JcrResourceResolverFactoryImpl()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext)
          Activates this component, called by SCR before registering as a service
protected  void bindResourceDecorator(ResourceDecorator decorator, Map<String,Object> props)
           
protected  void bindResourceProvider(ResourceProvider provider, Map<String,Object> props)
           
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
          Deativates this component, called by SCR to take out of service
 ResourceResolver getAdministrativeResourceResolver(Map<String,Object> authenticationInfo)
          Returns a new ResourceResolver instance with administrative privileges with further configuration taken from the given authenticationInfo map.
 Mapping[] getMappings()
           
 String getMapRoot()
           
protected  SlingRepository getRepository()
          Returns the JCR repository used by this factory
 ResourceDecoratorTracker getResourceDecoratorTracker()
           
 ResourceResolver getResourceResolver(Map<String,Object> authenticationInfo)
          Returns a new ResourceResolver instance with further configuration taken from the given authenticationInfo map.
 ResourceResolver getResourceResolver(javax.jcr.Session session)
          Returns a new ResourceResolve for the given session.
protected  ResourceProviderEntry getRootProviderEntry()
          Getter for rootProviderEntry, making it easier to extend JcrResourceResolverFactoryImpl.
 org.apache.commons.collections.BidiMap getVirtualURLMap()
           
protected  void unbindResourceDecorator(ResourceDecorator decorator, Map<String,Object> props)
           
protected  void unbindResourceProvider(ResourceProvider provider, Map<String,Object> props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_WORKSPACES

public static final String ALL_WORKSPACES
Special value which, if passed to listener.workspaces, will have resource events fired for all workspaces.

See Also:
Constant Field Values

PROP_PATH

public static final String PROP_PATH
See Also:
Constant Field Values
Constructor Detail

JcrResourceResolverFactoryImpl

public JcrResourceResolverFactoryImpl()
Method Detail

getResourceDecoratorTracker

public ResourceDecoratorTracker getResourceDecoratorTracker()

getResourceResolver

public ResourceResolver getResourceResolver(javax.jcr.Session session)
Returns a new ResourceResolve for the given session. Note that each call to this method returns a new resource manager instance.

Specified by:
getResourceResolver in interface JcrResourceResolverFactory
Parameters:
session - The JCR Session used by the created resource manager to access the repository.
See Also:
JcrResourceResolverFactory.getResourceResolver(javax.jcr.Session)

getAdministrativeResourceResolver

public ResourceResolver getAdministrativeResourceResolver(Map<String,Object> authenticationInfo)
                                                   throws LoginException
Description copied from interface: ResourceResolverFactory
Returns a new ResourceResolver instance with administrative privileges with further configuration taken from the given authenticationInfo map.

Note, that if the authenticationInfo map contains the ResourceResolverFactory.USER_IMPERSONATION attribute the ResourceResolver returned will only have administrative privileges if the user identified by the property has administrative privileges.

Specified by:
getAdministrativeResourceResolver in interface ResourceResolverFactory
Parameters:
authenticationInfo - A map of further credential information which may be used by the implementation to parametrize how the resource resolver is created. This may be null.
Returns:
A ResourceResolver with administrative privileges unless the ResourceResolverFactory.USER_IMPERSONATION was set in the authenticationInfo.
Throws:
LoginException - If an error occurrs creating the new ResourceResolver with the provided credential data.
See Also:
ResourceResolverFactory.getAdministrativeResourceResolver(java.util.Map)

getResourceResolver

public ResourceResolver getResourceResolver(Map<String,Object> authenticationInfo)
                                     throws LoginException
Description copied from interface: ResourceResolverFactory
Returns a new ResourceResolver instance with further configuration taken from the given authenticationInfo map. Generally this map will contain a user name and password to authenticate.

If the authenticationInfo map is null the ResourceResolver returned will generally not be authenticated and only provide minimal privileges, if any at all.

Specified by:
getResourceResolver in interface ResourceResolverFactory
Parameters:
authenticationInfo - A map of further credential information which may be used by the implementation to parametrize how the resource resolver is created. This may be null.
Returns:
A ResourceResolver according to the authenticationInfo.
Throws:
LoginException - If an error occurrs creating the new ResourceResolver with the provided credential data.
See Also:
ResourceResolverFactory.getResourceResolver(java.util.Map)

getVirtualURLMap

public org.apache.commons.collections.BidiMap getVirtualURLMap()

getMappings

public Mapping[] getMappings()

getMapRoot

public String getMapRoot()

getRootProviderEntry

protected ResourceProviderEntry getRootProviderEntry()
Getter for rootProviderEntry, making it easier to extend JcrResourceResolverFactoryImpl. See SLING-730

Returns:
Our rootProviderEntry

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext)
Activates this component, called by SCR before registering as a service


deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
Deativates this component, called by SCR to take out of service


bindResourceProvider

protected void bindResourceProvider(ResourceProvider provider,
                                    Map<String,Object> props)

unbindResourceProvider

protected void unbindResourceProvider(ResourceProvider provider,
                                      Map<String,Object> props)

bindResourceDecorator

protected void bindResourceDecorator(ResourceDecorator decorator,
                                     Map<String,Object> props)

unbindResourceDecorator

protected void unbindResourceDecorator(ResourceDecorator decorator,
                                       Map<String,Object> props)

getRepository

protected SlingRepository getRepository()
Returns the JCR repository used by this factory



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