Class SetConfigActionResponse
java.lang.Object
org.frontcache.io.ActionResponse
org.frontcache.io.SetConfigActionResponse
What
A file can be written and not applied (
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.
When
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.-
Field Summary
Fields inherited from class ActionResponse
RESPONSE_STATUS_ERROR, RESPONSE_STATUS_OK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWarning(String warning) getFile()booleanbooleanvoidMarks this response a refusal: ERROR status, nothing written.voidsetApplied(boolean applied) voidsetBackupFile(String backupFile) voidsetCurrentContent(String currentContent) voidvoidsetValidationErrors(List<String> validationErrors) voidsetWarnings(List<String> warnings) voidsetWritten(boolean written) Methods inherited from class ActionResponse
getAction, getErrorDescription, getResponseStatus, setAction, setErrorDescription, setResponseStatus
-
Constructor Details
-
SetConfigActionResponse
public SetConfigActionResponse()
-
-
Method Details
-
refuse
Marks this response a refusal: ERROR status, nothing written. -
getFile
-
setFile
-
isWritten
public boolean isWritten() -
setWritten
public void setWritten(boolean written) -
isApplied
public boolean isApplied() -
setApplied
public void setApplied(boolean applied) -
getBackupFile
-
setBackupFile
-
getValidationErrors
-
setValidationErrors
-
getWarnings
-
setWarnings
-
addWarning
-
getCurrentContent
-
setCurrentContent
-