Class AbstractPostOperation

  • All Implemented Interfaces:
    PostOperation
    Direct Known Subclasses:
    AbstractSlingPostOperation

    @Deprecated
    public abstract class AbstractPostOperation
    extends java.lang.Object
    implements PostOperation
    Deprecated.
    (SLING-6722): this class mixes Sling and JCR APIs which is not optimal as nowadays we favor the Sling APIs. There's no intention to remove it however, if you're using JCR APIs anyways in your project it's fine to use it. Theres no public replacement for it as I write this.
    The AbstractPostOperation class is a base implementation of the PostOperation service interface providing actual implementations with useful tooling and common functionality like preparing the change logs or saving or refreshing the JCR Session.
    • Constructor Detail

      • AbstractPostOperation

        public AbstractPostOperation()
        Deprecated.
    • Method Detail

      • run

        public void run​(SlingHttpServletRequest request,
                        PostResponse response,
                        SlingPostProcessor[] processors)
                 throws org.apache.sling.servlets.post.exceptions.PreconditionViolatedPersistenceException,
                        org.apache.sling.servlets.post.exceptions.TemporaryPersistenceException
        Deprecated.
        Prepares and finalizes the actual operation. Preparation encompasses getting the absolute path of the item to operate on by calling the getItemPath(SlingHttpServletRequest) method and setting the location and parent location on the response. After the operation has been done in the doRun(SlingHttpServletRequest, PostResponse, List) method the session is saved if there are unsaved modifications. In case of errorrs, the unsaved changes in the session are rolled back.
        Specified by:
        run in interface PostOperation
        Parameters:
        request - the request to operate on
        response - The PostResponse to record execution progress.
        processors - The array of processors
        Throws:
        org.apache.sling.servlets.post.exceptions.PreconditionViolatedPersistenceException - when a necessary precondition failed, and a retry without further changes doesn't make sense.
        org.apache.sling.servlets.post.exceptions.TemporaryPersistenceException - when a commit failed, but a retry could make the operation work successfully.