X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=dashboard%2Fwebapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fmodel%2FErrorTransport.java;h=f1250c1829fb37740ca7a9b4a7e102c1302b3e2c;hb=592ce20ec359928373de2e7f06214c8f8ad73c20;hp=516e3c8e3b22db7e67c1ca2b87e6cb77e3d75423;hpb=b96fd22c2a19b61bbd9d4c71c4f4a8fbb3741df1;p=nonrtric.git diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java index 516e3c8e..f1250c18 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,106 +28,106 @@ import java.time.Instant; */ public class ErrorTransport implements IDashboardResponse { - private Instant timestamp; - private Integer status; - private String error; - private String message; - private String path; - - /** - * Builds an empty object. - */ - public ErrorTransport() { - // no-arg constructor - } - - /** - * Convenience constructor for minimal value set. - * - * @param status - * Integer value like 400 - * @param error - * Error message - */ - public ErrorTransport(int status, String error) { - this(status, error, null, null); - } - - /** - * Convenience constructor for populating an error from an exception - * - * @param status - * Integer value like 400 - * @param throwable - * The caught exception/throwable to convert to String with - * an upper bound on characters - */ - public ErrorTransport(int status, Throwable throwable) { - this.timestamp = Instant.now(); - this.status = status; - final int enough = 256; - String exString = throwable.toString(); - this.error = exString.length() > enough ? exString.substring(0, enough) : exString; - } - - /** - * Builds an object with all fields - * - * @param status - * Integer value like 500 - * @param error - * Explanation - * @param message - * Additional explanation - * @param path - * Requested path - */ - public ErrorTransport(int status, String error, String message, String path) { - this.timestamp = Instant.now(); - this.status = status; - this.error = error; - this.message = message; - this.path = path; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public String getMessage() { - return message; - } - - public void setMessage(String error) { - this.message = error; - } - - public Instant getTimestamp() { - return timestamp; - } - - public void setTimestamp(Instant timestamp) { - this.timestamp = timestamp; - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } + private Instant timestamp; + private Integer status; + private String error; + private String message; + private String path; + + /** + * Builds an empty object. + */ + public ErrorTransport() { + // no-arg constructor + } + + /** + * Convenience constructor for minimal value set. + * + * @param status + * Integer value like 400 + * @param error + * Error message + */ + public ErrorTransport(int status, String error) { + this(status, error, null, null); + } + + /** + * Convenience constructor for populating an error from an exception + * + * @param status + * Integer value like 400 + * @param throwable + * The caught exception/throwable to convert to String with + * an upper bound on characters + */ + public ErrorTransport(int status, Throwable throwable) { + this.timestamp = Instant.now(); + this.status = status; + final int enough = 256; + String exString = throwable.toString(); + this.error = exString.length() > enough ? exString.substring(0, enough) : exString; + } + + /** + * Builds an object with all fields + * + * @param status + * Integer value like 500 + * @param error + * Explanation + * @param message + * Additional explanation + * @param path + * Requested path + */ + public ErrorTransport(int status, String error, String message, String path) { + this.timestamp = Instant.now(); + this.status = status; + this.error = error; + this.message = message; + this.path = path; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String error) { + this.message = error; + } + + public Instant getTimestamp() { + return timestamp; + } + + public void setTimestamp(Instant timestamp) { + this.timestamp = timestamp; + } + + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } }