Class PrincipalResource
- java.lang.Object
-
- org.apache.sling.api.adapter.SlingAdaptable
-
- org.apache.sling.api.resource.AbstractResource
-
- org.apache.sling.jackrabbit.usermanager.impl.resource.BaseResource
-
- org.apache.sling.jackrabbit.usermanager.impl.resource.PrincipalResource
-
- All Implemented Interfaces:
org.apache.sling.api.adapter.Adaptable
,org.apache.sling.api.resource.Resource
@Adaptable(adaptableClass=org.apache.sling.api.resource.Resource.class,adapters={@Adapter({java.util.Map.class,org.apache.sling.api.resource.ValueMap.class,java.security.Principal.class}),@Adapter(condition="If the resource is an PrincipalResource and represents a JCR principal",value=java.security.Principal.class)}) public class PrincipalResource extends BaseResource
Resource implementation for Principal (SLING-11098)
-
-
Field Summary
Fields Modifier and Type Field Description protected Principal
principal
-
Fields inherited from class org.apache.sling.jackrabbit.usermanager.impl.resource.BaseResource
resourceResolver
-
-
Constructor Summary
Constructors Constructor Description PrincipalResource(Principal principal, org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
adaptTo(Class<T> type)
String
getResourceType()
protected String
toResourceType(Principal principal)
determine the resource type for the principal.String
toString()
-
Methods inherited from class org.apache.sling.jackrabbit.usermanager.impl.resource.BaseResource
getPath, getResourceMetadata, getResourceResolver, getResourceSuperType
-
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren
-
-
-
-
Field Detail
-
principal
protected final Principal principal
-
-
Method Detail
-
toResourceType
protected String toResourceType(Principal principal)
determine the resource type for the principal.- Parameters:
principal
- the principal to consider- Returns:
- the resource type
-
getResourceType
public String getResourceType()
-
adaptTo
public <T> T adaptTo(Class<T> type)
- Specified by:
adaptTo
in interfaceorg.apache.sling.api.adapter.Adaptable
- Overrides:
adaptTo
in classorg.apache.sling.api.adapter.SlingAdaptable
-
-