Interface LazyCreationService.ParentCreationStrategy

  • Enclosing interface:
    LazyCreationService

    public static interface LazyCreationService.ParentCreationStrategy
    Strategy to create the parents of the retrieved resource.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.apache.sling.api.resource.Resource createParent​(org.apache.sling.api.resource.ResourceResolver resolver, org.apache.sling.api.resource.Resource parentsParent, String parentName, int level)
      Create the resource with the given administrative resolver.
    • Method Detail

      • createParent

        org.apache.sling.api.resource.Resource createParent​(org.apache.sling.api.resource.ResourceResolver resolver,
                                                            org.apache.sling.api.resource.Resource parentsParent,
                                                            String parentName,
                                                            int level)
                                                     throws javax.jcr.RepositoryException,
                                                            org.apache.sling.api.resource.PersistenceException
        Create the resource with the given administrative resolver. A ResourceResolver.commit() is not necessary - that's performed in the LazyCreationService.
        Parameters:
        resolver - an administrative resolver
        parentsParent - the parent of the parent resource at which to attach the new parent
        parentName - the name of the parent resource to create.
        level - informative, the level of the parent: 1 is the immediate parent of the resource, 2 the next level up, ...
        Returns:
        the created parent resource
        Throws:
        javax.jcr.RepositoryException
        org.apache.sling.api.resource.PersistenceException