package at.gv.egiz.eaaf.core.impl.data; import java.util.List; import at.gv.egiz.eaaf.core.impl.idp.auth.services.IErrorService.ActionType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; import lombok.extern.slf4j.Slf4j; @ToString @Builder @Slf4j @NoArgsConstructor @AllArgsConstructor public class ErrorConfig { @Getter @Setter private String action; @Getter @Setter private String externalCode; @Getter @Setter private String logLevel; @Getter @Setter private List internalCode; @Getter @Setter private Boolean defaultConfig; @Getter @Setter @Builder.Default private Boolean useInternalAsExternal = false; /** * Get type of error-handling flow. * * @return flow type */ public ActionType getActionType() { ActionType actionType = ActionType.fromString(action); if (actionType == null) { log.warn("Find unsupported Error-Handling-Flow: {}. Use: {} as backup", action, ActionType.TICKET); actionType = ActionType.TICKET; } return actionType; } }