Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [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 | */ |
| 16 | package org.onosproject.pcepio.protocol; |
| 17 | |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 18 | import java.util.List; |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 19 | |
| 20 | import org.jboss.netty.buffer.ChannelBuffer; |
| 21 | import org.onosproject.pcepio.exceptions.PcepParseException; |
| 22 | |
| 23 | /** |
| 24 | * Abstraction of an entity which provides PCEP error for PCEP error message. |
| 25 | */ |
| 26 | public interface PcepError { |
| 27 | |
| 28 | /** |
| 29 | * Returns the PcepRPObject List. |
| 30 | * |
| 31 | * @return list of type PcepRPObject |
| 32 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 33 | List<PcepRPObject> getRPObjList(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * Sets the RP Objects lists. |
| 37 | * |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 38 | * @param rpObjList list of type PcepRPObject |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 39 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 40 | void setRPObjList(List<PcepRPObject> rpObjList); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 41 | |
| 42 | /** |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 43 | * Returns the PcepLSObject List. |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 44 | * |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 45 | * @return list of type PcepLSObject |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 46 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 47 | List<PcepLSObject> getLSObjList(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 48 | |
| 49 | /** |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 50 | * Sets the LS Objects lists. |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 51 | * |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 52 | * @param lsObjList list of type PcepLSObject |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 53 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 54 | void setLSObjList(List<PcepLSObject> lsObjList); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 55 | |
| 56 | /** |
| 57 | * Returns the PcepErrorObject. |
| 58 | * |
| 59 | * @return list of type PcepErrorObject |
| 60 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 61 | List<PcepErrorObject> getErrorObjList(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 62 | |
| 63 | /** |
| 64 | * Sets the Error Objects lists. |
| 65 | * |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 66 | * @param errorObjList list of type PcepErrorObject |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 67 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 68 | void setErrorObjList(List<PcepErrorObject> errorObjList); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * Writes the byte stream of PCEP error to the channel buffer. |
| 72 | * |
| 73 | * @param bb of type channel buffer |
| 74 | * @return object length index |
| 75 | * @throws PcepParseException while writing Error part into ChannelBuffer |
| 76 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 77 | int write(ChannelBuffer bb) throws PcepParseException; |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 78 | |
| 79 | /** |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 80 | * Builder interface with get and set functions to build PcepError. |
| 81 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 82 | interface Builder { |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 83 | |
| 84 | /** |
| 85 | * Builds PcepError Object. |
| 86 | * |
| 87 | * @return PcepError Object |
| 88 | */ |
| 89 | PcepError build(); |
| 90 | |
| 91 | /** |
| 92 | * Returns the PcepRPObject. |
| 93 | * |
| 94 | * @return list of type PcepRPObject |
| 95 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 96 | List<PcepRPObject> getRPObjList(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 97 | |
| 98 | /** |
| 99 | * Sets RP Object lists and returns its builder. |
| 100 | * |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 101 | * @param rpObjList list of type PcepRpObject |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 102 | * @return builder by setting Linked list of RP Object |
| 103 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 104 | Builder setRPObjList(List<PcepRPObject> rpObjList); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 105 | |
| 106 | /** |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 107 | * Returns the PcepLSObject. |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 108 | * |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 109 | * @return lsObjList of type PcepLSObject |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 110 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 111 | List<PcepLSObject> getLSObjList(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 112 | |
| 113 | /** |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 114 | * Sets LS Object lists and returns its builder. |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 115 | * |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 116 | * @param lsObjList list of type PcepLSObject |
| 117 | * @return builder by setting list of type PcepLSObject |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 118 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 119 | Builder setLSObjList(List<PcepLSObject> lsObjList); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 120 | |
| 121 | /** |
| 122 | * Returns the PcepErrorObject. |
| 123 | * |
| 124 | * @return list of type PcepErrorObject |
| 125 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 126 | List<PcepErrorObject> getErrorObjList(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 127 | |
| 128 | /** |
| 129 | * Sets Error Object lists and returns its builder. |
| 130 | * |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 131 | * @param errorObjList list of type PcepErrorObject |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 132 | * @return builder by setting list of type PcepErrorObject |
| 133 | */ |
Mahesh Poojary S | f1bbd36 | 2016-02-25 18:19:59 +0530 | [diff] [blame] | 134 | Builder setErrorObjList(List<PcepErrorObject> errorObjList); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 135 | } |
| 136 | } |