mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 16 | package org.onosproject.pcep.server; |
mohamedrahil | 00f6f26 | 2016-11-24 20:20:41 +0530 | [diff] [blame] | 17 | |
| 18 | import java.util.Map; |
| 19 | import java.util.TreeMap; |
| 20 | |
| 21 | /** |
| 22 | * PCEP error message details. |
| 23 | */ |
| 24 | public class PcepErrorDetail { |
| 25 | |
| 26 | private Map<Integer, String> sessionEstablishmentFailureMap = new TreeMap<>(); |
| 27 | private Map<Integer, String> unknownObjectMap = new TreeMap<>(); |
| 28 | private Map<Integer, String> notSupportedObjectMap = new TreeMap<>(); |
| 29 | private Map<Integer, String> policyViolationMap = new TreeMap<>(); |
| 30 | private Map<Integer, String> mandatoryObjectMissingMap = new TreeMap<>(); |
| 31 | private Map<Integer, String> receptionOfInvalidObjectMap = new TreeMap<>(); |
| 32 | private Map<Integer, String> invalidOperationMap = new TreeMap<>(); |
| 33 | |
| 34 | |
| 35 | public Map sessionEstablishmentFailure() { |
| 36 | sessionEstablishmentFailureMap.put(1, "Reception of an invalid Open message or a non Open message."); |
| 37 | sessionEstablishmentFailureMap.put(2, "no Open message received before the expiration of the OpenWait timer"); |
| 38 | sessionEstablishmentFailureMap.put(3, "unacceptable and non-negotiable session characteristics"); |
| 39 | sessionEstablishmentFailureMap.put(4, "unacceptable but negotiable session characteristics"); |
| 40 | sessionEstablishmentFailureMap.put(5, "reception of a second Open message with still " + |
| 41 | "unacceptable session characteristics"); |
| 42 | sessionEstablishmentFailureMap.put(6, "reception of a PCErr message proposing unacceptable " + |
| 43 | "session characteristics"); |
| 44 | sessionEstablishmentFailureMap.put(7, "No Keepalive or PCErr message received before the " + |
| 45 | "expiration of the KeepWait timer"); |
| 46 | sessionEstablishmentFailureMap.put(8, "PCEP version not supported"); |
| 47 | return sessionEstablishmentFailureMap; |
| 48 | } |
| 49 | |
| 50 | |
| 51 | public Map unknownObject() { |
| 52 | unknownObjectMap.put(1, "Unrecognized object class"); |
| 53 | unknownObjectMap.put(2, "Unrecognized object type"); |
| 54 | return unknownObjectMap; |
| 55 | } |
| 56 | |
| 57 | public Map notSupportedObject() { |
| 58 | notSupportedObjectMap.put(1, "Not Supported object class"); |
| 59 | notSupportedObjectMap.put(2, "Not Supported object type"); |
| 60 | return notSupportedObjectMap; |
| 61 | } |
| 62 | |
| 63 | |
| 64 | public Map policyViolation() { |
| 65 | policyViolationMap.put(1, "C bit of the METRIC object set (request rejected)"); |
| 66 | policyViolationMap.put(2, "O bit of the RP object cleared (request rejected)"); |
| 67 | return policyViolationMap; |
| 68 | } |
| 69 | |
| 70 | |
| 71 | |
| 72 | public Map mandatoryObjectMissing() { |
| 73 | mandatoryObjectMissingMap.put(1, "RP object missing"); |
| 74 | mandatoryObjectMissingMap.put(2, "RRO missing for a re-optimization request (R bit of the RP object set)"); |
| 75 | mandatoryObjectMissingMap.put(2, "END-POINTS object missing"); |
| 76 | return mandatoryObjectMissingMap; |
| 77 | |
| 78 | } |
| 79 | |
| 80 | |
| 81 | public Map receptionOfInvalidObject() { |
| 82 | receptionOfInvalidObjectMap.put(1, "reception of an object with P flag not set although the P flag must be" + |
| 83 | "set according to this specification."); |
| 84 | return receptionOfInvalidObjectMap; |
| 85 | } |
| 86 | |
| 87 | public Map invalidOperation() { |
| 88 | invalidOperationMap.put(1, "Attempted LSP Update Request for a non-delegated LSP. The PCEP-ERROR Object" + |
| 89 | " is followed by the LSP Object that identifies the LSP."); |
| 90 | invalidOperationMap.put(2, "Attempted LSP Update Request if the" + |
| 91 | " stateful PCE capability was not" + |
| 92 | " advertised."); |
| 93 | invalidOperationMap.put(3, "Attempted LSP Update Request for an LSP" + |
| 94 | "identified by an unknown PLSP-ID."); |
| 95 | invalidOperationMap.put(4, "A PCE indicates to a PCC that it has" + |
| 96 | " exceeded the resource limit allocated" + |
| 97 | " for its state, and thus it cannot" + |
| 98 | " accept and process its LSP State Report" + |
| 99 | " message."); |
| 100 | invalidOperationMap.put(5, "Attempted LSP State Report if active" + |
| 101 | " stateful PCE capability was not" + |
| 102 | " advertised."); |
| 103 | return invalidOperationMap; |
| 104 | } |
| 105 | |
| 106 | |
| 107 | |
| 108 | } |