blob: b61bfb9f92972e2560f3f6170a6750fb7568b42e [file] [log] [blame]
Sho SHIMIZU74361c12015-08-11 12:31:48 -07001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.pcepio.protocol;
17
18import java.util.LinkedList;
19
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 */
33 LinkedList<PcepRPObject> getRPObjList();
34
35 /**
36 * Sets the RP Objects lists.
37 *
38 * @param llRPObjList list of type PcepRPObject
39 */
40 void setRPObjList(LinkedList<PcepRPObject> llRPObjList);
41
42 /**
43 * Returns the PcepTEObject List.
44 *
45 * @return list of type PcepTEObject
46 */
47 LinkedList<PcepTEObject> getTEObjList();
48
49 /**
50 * Sets the TE Objects lists.
51 *
52 * @param llTEObjList list of type PcepTEObject
53 */
54 void setTEObjList(LinkedList<PcepTEObject> llTEObjList);
55
56 /**
57 * Returns the PcepErrorObject.
58 *
59 * @return list of type PcepErrorObject
60 */
61 LinkedList<PcepErrorObject> getErrorObjList();
62
63 /**
64 * Sets the Error Objects lists.
65 *
66 * @param llErrorObjList list of type PcepErrorObject
67 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070068 void setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList);
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 */
96 LinkedList<PcepRPObject> getRPObjList();
97
98 /**
99 * Sets RP Object lists and returns its builder.
100 *
101 * @param llRPObjList list of type PcepRpObject
102 * @return builder by setting Linked list of RP Object
103 */
104 Builder setRPObjList(LinkedList<PcepRPObject> llRPObjList);
105
106 /**
107 * Returns the PcepTEObject.
108 *
109 * @return llTEObjList of type PcepTEObject
110 */
111 LinkedList<PcepTEObject> getTEObjList();
112
113 /**
114 * Sets TE Object lists and returns its builder.
115 *
116 * @param llTEObjList list of type PcepTEObject
117 * @return builder by setting list of type PcepTEObject
118 */
119 Builder setTEObjList(LinkedList<PcepTEObject> llTEObjList);
120
121 /**
122 * Returns the PcepErrorObject.
123 *
124 * @return list of type PcepErrorObject
125 */
126 LinkedList<PcepErrorObject> getErrorObjList();
127
128 /**
129 * Sets Error Object lists and returns its builder.
130 *
131 * @param llErrorObjList list of type PcepErrorObject
132 * @return builder by setting list of type PcepErrorObject
133 */
134 Builder setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList);
135 }
136}