Class SetConfigActionResponse

java.lang.Object
org.frontcache.io.ActionResponse
org.frontcache.io.SetConfigActionResponse

public class SetConfigActionResponse extends ActionResponse
What set-config did, or refused to do.

written and applied are separate on purpose

A file can be written and not applied (apply=false, or a reload that reported a problem), and a refusal writes nothing at all. Collapsing the two into one status would leave the console saying "saved" for a node whose running configuration did not change, which is the whole thing the Configs screens exist to make visible.

validationErrors versus warnings

An error means nothing was written - the file was dry-parsed first and did not survive it, and the message carries the line number. A warning means the write happened and there is something the operator has to know anyway: a file that had to be created, a resilience setting that needs a restart, the circuit state a reload reset. Both are lists because one bad paste produces several.

currentContent is only filled on a conflict

When baseHash does not match what is on disk, someone else changed the file since the console rendered it. Returning the current content with the refusal is what lets the console show the operator what they were about to overwrite, instead of only telling them they could not.
  • Constructor Details

    • SetConfigActionResponse

      public SetConfigActionResponse()
  • Method Details

    • refuse

      public void refuse(String reason)
      Marks this response a refusal: ERROR status, nothing written.
    • getFile

      public String getFile()
    • setFile

      public void setFile(String file)
    • isWritten

      public boolean isWritten()
    • setWritten

      public void setWritten(boolean written)
    • isApplied

      public boolean isApplied()
    • setApplied

      public void setApplied(boolean applied)
    • getBackupFile

      public String getBackupFile()
    • setBackupFile

      public void setBackupFile(String backupFile)
    • getValidationErrors

      public List<String> getValidationErrors()
    • setValidationErrors

      public void setValidationErrors(List<String> validationErrors)
    • getWarnings

      public List<String> getWarnings()
    • setWarnings

      public void setWarnings(List<String> warnings)
    • addWarning

      public void addWarning(String warning)
    • getCurrentContent

      public String getCurrentContent()
    • setCurrentContent

      public void setCurrentContent(String currentContent)