2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.logging.filter.base;
23 public enum CustomResponseStatus {
24 PROCESSING(102, "Processing"),
25 MULTI_STATUS(207, "Multi-Status"),
26 ALREADY_REPORTED(208, "Already Reported"),
27 UNPROCESSABLE_ENTITY(422, "Unprocessable Entity"),
28 LOCKED(423, "Locked"),
29 FAILED_DEPENDENCY(424, "Failed Dependency"),
30 INSUFFICIENT_STORAGE(508, "Insufficient Storage"),
31 LOOP_DETECTED(508, "Loop Detected");
33 private final int code;
34 private final String reason;
36 CustomResponseStatus(int statusCode, String reasonPhrase) {
37 this.code = statusCode;
38 this.reason = reasonPhrase;
41 public static CustomResponseStatus fromStatusCode(int statusCode) {
42 for (CustomResponseStatus s : values()) {
43 if (s.code == statusCode) {
51 public int getStatusCode() {
55 public String getReasonPhrase() {
56 return this.toString();
59 public String toString() {