Class AbstractPostOperation

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public abstract class AbstractPostOperation
    extends Object
    implements PostOperation
    (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()
    • Method Detail

      • run

        public void run​(SlingHttpServletRequest request,
                        PostResponse response,
                        SlingPostProcessor[] processors)
        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
        request - the request to operate on
        response - The PostResponse to record execution progress.
        processors - The array of processors
        Throws: - when a necessary precondition failed, and a retry without further changes doesn't make sense. - when a commit failed, but a retry could make the operation work successfully.