blob: 75e0051cc3a3567c55119f4d2860cc4daa667439 [file] [log] [blame]
Sho SHIMIZU74361c12015-08-11 12:31:48 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Sho SHIMIZU74361c12015-08-11 12:31:48 -07003 *
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 */
16package org.onosproject.pcepio.protocol;
17
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053018import java.util.List;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070019
20import org.jboss.netty.buffer.ChannelBuffer;
21import org.onosproject.pcepio.exceptions.PcepParseException;
22
23/**
24 * Abstraction of an entity which provides PCEP error for PCEP error message.
25 */
26public interface PcepError {
27
28 /**
29 * Returns the PcepRPObject List.
30 *
31 * @return list of type PcepRPObject
32 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053033 List<PcepRPObject> getRPObjList();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070034
35 /**
36 * Sets the RP Objects lists.
37 *
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053038 * @param rpObjList list of type PcepRPObject
Sho SHIMIZU74361c12015-08-11 12:31:48 -070039 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053040 void setRPObjList(List<PcepRPObject> rpObjList);
Sho SHIMIZU74361c12015-08-11 12:31:48 -070041
42 /**
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053043 * Returns the PcepLSObject List.
Sho SHIMIZU74361c12015-08-11 12:31:48 -070044 *
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053045 * @return list of type PcepLSObject
Sho SHIMIZU74361c12015-08-11 12:31:48 -070046 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053047 List<PcepLSObject> getLSObjList();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070048
49 /**
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053050 * Sets the LS Objects lists.
Sho SHIMIZU74361c12015-08-11 12:31:48 -070051 *
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053052 * @param lsObjList list of type PcepLSObject
Sho SHIMIZU74361c12015-08-11 12:31:48 -070053 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053054 void setLSObjList(List<PcepLSObject> lsObjList);
Sho SHIMIZU74361c12015-08-11 12:31:48 -070055
56 /**
57 * Returns the PcepErrorObject.
58 *
59 * @return list of type PcepErrorObject
60 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053061 List<PcepErrorObject> getErrorObjList();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070062
63 /**
64 * Sets the Error Objects lists.
65 *
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053066 * @param errorObjList list of type PcepErrorObject
Sho SHIMIZU74361c12015-08-11 12:31:48 -070067 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +053068 void setErrorObjList(List<PcepErrorObject> errorObjList);
Sho SHIMIZU74361c12015-08-11 12:31:48 -070069
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 SHIMIZU260f6ef2015-08-11 13:53:31 -070077 int write(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070078
79 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -070080 * Builder interface with get and set functions to build PcepError.
81 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070082 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -070083
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 Sf1bbd362016-02-25 18:19:59 +053096 List<PcepRPObject> getRPObjList();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070097
98 /**
99 * Sets RP Object lists and returns its builder.
100 *
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530101 * @param rpObjList list of type PcepRpObject
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700102 * @return builder by setting Linked list of RP Object
103 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530104 Builder setRPObjList(List<PcepRPObject> rpObjList);
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700105
106 /**
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530107 * Returns the PcepLSObject.
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700108 *
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530109 * @return lsObjList of type PcepLSObject
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700110 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530111 List<PcepLSObject> getLSObjList();
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700112
113 /**
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530114 * Sets LS Object lists and returns its builder.
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700115 *
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530116 * @param lsObjList list of type PcepLSObject
117 * @return builder by setting list of type PcepLSObject
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700118 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530119 Builder setLSObjList(List<PcepLSObject> lsObjList);
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700120
121 /**
122 * Returns the PcepErrorObject.
123 *
124 * @return list of type PcepErrorObject
125 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530126 List<PcepErrorObject> getErrorObjList();
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700127
128 /**
129 * Sets Error Object lists and returns its builder.
130 *
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530131 * @param errorObjList list of type PcepErrorObject
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700132 * @return builder by setting list of type PcepErrorObject
133 */
Mahesh Poojary Sf1bbd362016-02-25 18:19:59 +0530134 Builder setErrorObjList(List<PcepErrorObject> errorObjList);
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700135 }
136}