|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.resourceresolver.impl.helper.ResourceResolverContext
public class ResourceResolverContext
This class keeps track of the used resource providers for a resource resolver. Like a resource resolver itself, this class is not thread safe.
| Constructor Summary | |
|---|---|
ResourceResolverContext(boolean isAdmin,
Map<String,Object> originalAuthInfo,
ResourceAccessSecurityTracker resourceAccessSecurityTracker)
Create a new resource resolver context. |
|
| Method Summary | ||
|---|---|---|
void |
addFactoryResourceProvider(Long key,
org.apache.sling.api.resource.ResourceProvider provider)
Add a new resource provider |
|
void |
close()
Close all dynamic resource providers. |
|
void |
commit(org.apache.sling.api.resource.ResourceResolver resolver)
Commit all transient changes |
|
Map<String,Object> |
getAuthenticationInfo()
Return the authentication info. |
|
org.apache.sling.api.resource.ResourceProvider |
getFactoryResourceProvider(Long key)
Return a resource provider for a given key |
|
String |
getParentResourceType(org.apache.sling.api.resource.ResourceResolverFactory factory,
org.apache.sling.api.resource.ResourceResolver resolver,
String resourceType)
Get the parent resource type |
|
static String |
getProperty(org.apache.sling.api.resource.Resource res,
String propName)
Returns getProperty(res,
propName, String.class) |
|
static
|
getProperty(org.apache.sling.api.resource.Resource res,
String propName,
Class<Type> type)
Returns the value of the name property of the resource converted to the requested type. |
|
ResourceAccessSecurityTracker |
getResourceAccessSecurityTracker()
get's the ServiceTracker of the ResourceAccessSecurity service |
|
boolean |
hasChanges(org.apache.sling.api.resource.ResourceResolver resolver)
Do we have changes? |
|
boolean |
isAdmin()
Is this an admin resource resolver. |
|
boolean |
isLive()
Check all active dynamic resource providers. |
|
void |
refresh()
Refresh |
|
void |
revert(org.apache.sling.api.resource.ResourceResolver resolver)
Revert all transient changes. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceResolverContext(boolean isAdmin,
Map<String,Object> originalAuthInfo,
ResourceAccessSecurityTracker resourceAccessSecurityTracker)
| Method Detail |
|---|
public boolean isAdmin()
public Map<String,Object> getAuthenticationInfo()
public void addFactoryResourceProvider(Long key,
org.apache.sling.api.resource.ResourceProvider provider)
key - The unique key of the providerprovider - The provider.public org.apache.sling.api.resource.ResourceProvider getFactoryResourceProvider(Long key)
key - The unique key of a provider
nullpublic boolean isLive()
public void close()
public void revert(org.apache.sling.api.resource.ResourceResolver resolver)
public void commit(org.apache.sling.api.resource.ResourceResolver resolver)
throws org.apache.sling.api.resource.PersistenceException
org.apache.sling.api.resource.PersistenceExceptionpublic boolean hasChanges(org.apache.sling.api.resource.ResourceResolver resolver)
public void refresh()
public ResourceAccessSecurityTracker getResourceAccessSecurityTracker()
public String getParentResourceType(org.apache.sling.api.resource.ResourceResolverFactory factory,
org.apache.sling.api.resource.ResourceResolver resolver,
String resourceType)
ResourceResolver.getParentResourceType(java.lang.String)
public static String getProperty(org.apache.sling.api.resource.Resource res,
String propName)
getProperty(res,
propName, String.class)
res - The resource to access the property frompropName - The name of the property to access
String or null if the property
does not exist or cannot be converted into a String
public static <Type> Type getProperty(org.apache.sling.api.resource.Resource res,
String propName,
Class<Type> type)
type.
If the resource itself does not have the property, the property is looked
up in the jcr:content child node. This access is done through the
same ValueMap as is used to access the property directly. This
generally only works for JCR based ValueMap instances which
provide access to relative path property names. This may not work in non
JCR ValueMap, however in non JCR envs there is usually no
"jcr:content" child node anyway
res - The resource to access the property frompropName - The name of the property to accesstype - The type into which to convert the property
type or
null if the property does not exist or cannot be
converted into the requested type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||