Interface ItemPersistRequestValidator

All Known Implementing Classes:
ItemPersistRequestPermissionValidator

public interface ItemPersistRequestValidator
A validator for ItemModels that is requested for persistence, which ensures certain conditions are met before saving the ItemModel. If conditions are not met the validator can throw an instance of RuntimeException and to veto the search.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    validate(PersistenceContext context, ItemModel itemModel)
    Validates the item can be persisted with the given context and rejects it by throwing an exception, if the specified request does not meet certain criteria.
  • Method Details

    • validate

      void validate(PersistenceContext context, ItemModel itemModel)
      Validates the item can be persisted with the given context and rejects it by throwing an exception, if the specified request does not meet certain criteria.
      Parameters:
      context - a persistence context containing information about the item being persisted.
      itemModel - an item to be persisted
      Throws:
      RuntimeException - if request is not valid and cannot be corrected.