In order to post process write requests as described above, create a class implementing the
interface ContentWritePostprocessor
. Alternatively, your class can also inherit
from ContentWritePostprocessorBase
, which already defines methods to configure
the content type to which the write interceptor applies, and the priority at which the
interceptor runs compared to other applicable interceptors.
This leaves only the method postProcess(WriteReport<Content>)
to be
implemented in custom code. The argument of the postProcess
method provides
access to all information needed for post processing the current request, which is either an
update request or a create request.
The method getEntity()
returns the content on which an update request has been
executed. A write interceptor may use this method to determine the context of a write request.
The method getOverwrittenProperties()
of the WriteReport
object
returns a map from property names to the values that have been overwritten during the write
request. The new values can be retrieved as the current property value of the content returned
from the method getEntity()
.