Interface PostOperation
- 
- All Known Implementing Classes:
 AbstractPostOperation,AbstractSlingPostOperation,CommentingOperationHandler,CopyStylePostOperation,SaveThemePostOperation
public interface PostOperationThePostOperationinterface defines the service API to be implemented by service providers extending the Sling POST servlet. Service providers may register OSGi services of this type to be used by the Sling default POST servlet to handle specific operations.The
PostOperationservice must be registered with aPROP_OPERATION_NAMEregistration property giving the name(s) of the operations supported by the service. The names will be used to find the actual operation from the:operationrequest parameter.The Sling POST servlet itself provides various operations (see the
OPERATION_constants in theSlingPostConstantsinterface.These names should not be used bySlingPostOperationservice providers.This interface replaces the old
SlingPostOperationservice interface adding support for extensible responses by means of thePostResponseinterface as well as operation postprocessing.Implementors of this interface are advised to extend the
AbstractPostOperationclass to benefit from various processings implemented by that abstract class. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_OPERATION_NAMEThe name of the service registration property indicating the name(s) of the operation provided by the operation implementation.static java.lang.StringSERVICE_NAMEThe name of the Sling POST operation service. 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidrun(SlingHttpServletRequest request, PostResponse response, SlingPostProcessor[] processors)Executes the operation provided by this service implementation. 
 - 
 
- 
- 
Field Detail
- 
SERVICE_NAME
static final java.lang.String SERVICE_NAME
The name of the Sling POST operation service.- See Also:
 - Constant Field Values
 
 
- 
PROP_OPERATION_NAME
static final java.lang.String PROP_OPERATION_NAME
The name of the service registration property indicating the name(s) of the operation provided by the operation implementation. The value of this service property must be a single String or an array orjava.util.Collectionof Strings. If multiple strings are defined, the service is registered for all operation names.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
run
void run(SlingHttpServletRequest request, PostResponse response, SlingPostProcessor[] processors) throws org.apache.sling.servlets.post.exceptions.PreconditionViolatedPersistenceException, org.apache.sling.servlets.post.exceptions.TemporaryPersistenceException, PersistenceException
Executes the operation provided by this service implementation. This method is called by the Sling POST servlet.- Parameters:
 request- TheSlingHttpServletRequestobject providing the request input for the operation.response- TheHtmlResponseinto which the operation steps should be recorded.processors- TheSlingPostProcessorservices to be called after applying the operation. This may benullif there are none.- Throws:
 PersistenceException- when the commit failsResourceNotFoundException- May be thrown if the operation requires an existing request resource. If this exception is thrown the Sling POST servlet sends back a404/NOT FOUNDresponse to the client.SlingException- May be thrown if an error Occurs running the operation.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.
 
 - 
 
 -