blob: 0c625a03a985422b630831588969b041a9e07b12 [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 Info.
25 * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02.
26 */
27public interface PcepErrorInfo {
28
29 /**
30 * Returns whether error info list is present or not.
31 *
32 * @return true if error info present, false otherwise
33 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070034 boolean isErrorInfoPresent();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070035
36 /**
37 * Reads from channel buffer for TE and RP objects.
38 *
39 * @param bb of channel buffer
40 * @throws PcepParseException while parsing Error info part.
41 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070042 void read(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070043
44 /**
45 * Writes byte stream of PCEP error info to channel buffer.
46 *
47 * @param bb of type channel buffer
48 * @throws PcepParseException while writing Error info part into Channel Buffer.
49 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070050 void write(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070051
52 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -070053 * Returns Error Value in PCEP-ERROR Object.
54 *
55 * @return list of Error Value in PCEP-ERROR Object
56 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070057 LinkedList<Integer> getErrorValue();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070058
59 /**
60 * Returns Error Type in PCEP-ERROR Object.
61 *
62 * @return list of Error Type in PCEP-ERROR Object
63 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070064 LinkedList<Integer> getErrorType();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070065
66 /**
67 * Builder interface with get and set functions to build ErrorInfo.
68 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070069 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -070070
71 /**
72 * Builds ErrorInfo Object.
73 *
74 * @return ErrorInfo Object.
75 */
76 PcepErrorInfo build();
77
78 /**
79 * Returns list of PcepError.
80 *
81 * @return list of PcepError
82 */
83 LinkedList<PcepError> getPcepErrorList();
84
85 /**
86 * Sets PcepError lists and returns its builder.
87 *
88 * @param llPcepErrorList list of PcepError
89 * @return builder by setting list of PcepError.
90 */
91 Builder setPcepErrorList(LinkedList<PcepError> llPcepErrorList);
92 }
93}