Package org.apache.sling.servlets.post
Class AbstractPostOperation
java.lang.Object
org.apache.sling.servlets.post.AbstractPostOperation
- All Implemented Interfaces:
PostOperation
- Direct Known Subclasses:
AbstractSlingPostOperation
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.-
Field Summary
Fields inherited from interface org.apache.sling.servlets.post.PostOperation
PROP_OPERATION_NAME, SERVICE_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun(SlingHttpServletRequest request, PostResponse response, SlingPostProcessor[] processors) Deprecated.Prepares and finalizes the actual operation.
-
Constructor Details
-
AbstractPostOperation
public AbstractPostOperation()Deprecated.
-
-
Method Details
-
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 thegetItemPath(SlingHttpServletRequest)method and setting the location and parent location on the response. After the operation has been done in thedoRun(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:
runin interfacePostOperation- Parameters:
request- the request to operate onresponse- ThePostResponseto 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.
-