Interface SaveOperation


public interface SaveOperation
Operation to save a store element with defined options.

The common way to use this operation is to:

  • lock the desired element;
  • make changes to its data;
  • save the element using this operation;
  • unlock the element.
In case of operating on multiple elements, this operation may be configured once and called on each element consecutively.
Since:
5.2.1804
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Operation to save a store element with defined options.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    perform(@NotNull StoreElement element)
    Performs this operation on the given element.
    void
    setComment(@Nullable String comment)
    Defines the comment to be used for saving.
    void
    setRecursionEnabled(boolean enable)
    Defines, whether child elements should be saved, too.
    void
    setValidationEnabled(boolean enable)
    Defines, whether validation shall be performed on the element's data.
  • Field Details

  • Method Details

    • setComment

      void setComment(@Nullable @Nullable String comment)
      Defines the comment to be used for saving.
      If not set, defaults to null.
      Parameters:
      comment - The comment to be set.
      Since:
      5.2.1804
    • setRecursionEnabled

      void setRecursionEnabled(boolean enable)
      Defines, whether child elements should be saved, too. If enabled, children of the targeted element will be saved as well, as long as they are in a locked state. If saving a child fails for validation reasons, found problems will be returned in the accumulated report exception.
      If not set, defaults to false.
      Parameters:
      enable - if true, child elements of the given element will be saved as well.
      Since:
      5.2.1804
    • setValidationEnabled

      void setValidationEnabled(boolean enable)
      Defines, whether validation shall be performed on the element's data.
      If not set, defaults to true.
      Parameters:
      enable - if true, data will be validated before saving the element.
      Since:
      5.2.1804
    • perform

      void perform(@NotNull @NotNull StoreElement element) throws ElementValidationReportsException, IllegalArgumentException
      Performs this operation on the given element. As a prerequisite, the element must be locked.
      Parameters:
      element - The element to be saved.
      Throws:
      ElementValidationReportsException - If validating failed.
      IllegalArgumentException - If the given element type is not supported.
      IllegalStateException - If the given element is not locked.
      Since:
      5.2.1804