/** * */ package vn.mobileid.fms.client; // TODO: Auto-generated Javadoc /** * The Class JCRException. * * @author ThaoTruong * @created Oct 10, 2018 */ public class JCRException extends Exception{ /** The Constant CREATE_INSTANCE_ERROR. */ public static final int CREATE_INSTANCE_ERROR = 1; /** The Constant UPLOAD_FILE_ERROR. */ public static final int UPLOAD_FILE_ERROR = 2; /** The Constant DOWNLOAD_FILE_ERROR. */ public static final int DOWNLOAD_FILE_ERROR = 3; /** The Constant CREATE_WORKSPACE_ERROR. */ public static final int CREATE_WORKSPACE_ERROR = 4; /** The Constant DELETE_WORKSPACE_ERROR. */ public static final int DELETE_WORKSPACE_ERROR = 6; /** The Constant CHANGE_PSW_ERROR. */ public static final int CHANGE_PSW_ERROR = 5; public static final int URL_INVALID = 6; public static final int NO_REPOSITORY_AVAIABLE = 7; public static final int UNKOWN = 255; /** The Constant serialVersionUID. */ private static final long serialVersionUID = -7367113248296925665L; /** The code. */ private int code; /** The msg. */ private String msg; /** The diagnostic. */ protected static String diagnostic = "JCR Exception"; /** * */ public JCRException(String msg) { // TODO Auto-generated constructor stub this(UNKOWN, msg); } /** * Instantiates a new JCR exception. * * @param code the code * @param msg the msg */ public JCRException(int code, String msg) { // TODO Auto-generated constructor stub super(diagnostic + ": " + msg); this.code = code; this.msg = diagnostic + ": " + msg; } public JCRException(int code, String msg, Throwable cause) { super(diagnostic + ": " + msg, cause); this.code = code; this.msg = diagnostic + ": " + msg; } /** * @param uploadFileError * @param e */ public JCRException(int uploadFileError, Throwable e) { // TODO Auto-generated constructor stub super(e); super.addSuppressed(e); this.code = uploadFileError; } /** * Gets the code. * * @return the code */ public int getCode() { return code; } /** * Sets the code. * * @param code the new code */ public void setCode(int code) { this.code = code; } /** * Gets the msg. * * @return the msg */ public String getMsg() { return msg; } /** * Sets the msg. * * @param msg the new msg */ public void setMsg(String msg) { this.msg = msg; } }