blob: 1dc8a3f1e6dc726551f97a23e9e29b6ddc3303d0 [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 /**
80 * Prints the attributes of PCEP Error.
81 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070082 void print();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070083
84 /**
85 * Builder interface with get and set functions to build PcepError.
86 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070087 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -070088
89 /**
90 * Builds PcepError Object.
91 *
92 * @return PcepError Object
93 */
94 PcepError build();
95
96 /**
97 * Returns the PcepRPObject.
98 *
99 * @return list of type PcepRPObject
100 */
101 LinkedList<PcepRPObject> getRPObjList();
102
103 /**
104 * Sets RP Object lists and returns its builder.
105 *
106 * @param llRPObjList list of type PcepRpObject
107 * @return builder by setting Linked list of RP Object
108 */
109 Builder setRPObjList(LinkedList<PcepRPObject> llRPObjList);
110
111 /**
112 * Returns the PcepTEObject.
113 *
114 * @return llTEObjList of type PcepTEObject
115 */
116 LinkedList<PcepTEObject> getTEObjList();
117
118 /**
119 * Sets TE Object lists and returns its builder.
120 *
121 * @param llTEObjList list of type PcepTEObject
122 * @return builder by setting list of type PcepTEObject
123 */
124 Builder setTEObjList(LinkedList<PcepTEObject> llTEObjList);
125
126 /**
127 * Returns the PcepErrorObject.
128 *
129 * @return list of type PcepErrorObject
130 */
131 LinkedList<PcepErrorObject> getErrorObjList();
132
133 /**
134 * Sets Error Object lists and returns its builder.
135 *
136 * @param llErrorObjList list of type PcepErrorObject
137 * @return builder by setting list of type PcepErrorObject
138 */
139 Builder setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList);
140 }
141}