Correct way of handling dialog save operation on backend for AEMaaCS
We migrate our project from On Prem to Cloud. On Prem used a feature called "protected areas" where specific pages were protected by password. In order to set this password on specific page properties we had a custom PostOperation service to get that password from request parameter and store it in CRX after CryptoSupport encryption. In current AEM SDK I can see that I cannot compile my custom class implementing PostOperation due to
[ERROR] cannot access org.apache.sling.servlets.post.exceptions.PreconditionViolatedPersistenceException
[ERROR] class file for org.apache.sling.servlets.post.exceptions.PreconditionViolatedPersistenceException not found
[ERROR] cannot access org.apache.sling.servlets.post.exceptions.TemporaryPersistenceException
[ERROR] class file for org.apache.sling.servlets.post.exceptions.TemporaryPersistenceException not found
and in fact those exception classes are not available in AEM SDK jar. Moreover it seems like Abstract for this PostOperation interface is deprecated.
What is a current approach of listening to dialog changes in order to process those parameters before saving to CRX?