Class 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 Detail

      • principal

        protected final Principal principal
    • Constructor Detail

      • PrincipalResource

        public PrincipalResource​(Principal principal,
                                 org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                 String path)
    • 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 interface org.apache.sling.api.adapter.Adaptable
        Overrides:
        adaptTo in class org.apache.sling.api.adapter.SlingAdaptable