Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 1 | /*
|
| 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 | */
|
| 16 | package org.onosproject.pcepio.protocol;
|
| 17 |
|
| 18 | import java.util.LinkedList;
|
| 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 Info.
|
| 25 | * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02.
|
| 26 | */
|
| 27 | public 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 | */
|
| 34 | public boolean isErrorInfoPresent();
|
| 35 |
|
| 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 | */
|
| 42 | public void read(ChannelBuffer bb) throws PcepParseException;
|
| 43 |
|
| 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 | */
|
| 50 | public void write(ChannelBuffer bb) throws PcepParseException;
|
| 51 |
|
| 52 | /**
|
| 53 | * Prints the attributes of error info list.
|
| 54 | */
|
| 55 | public void print();
|
| 56 |
|
| 57 | /**
|
| 58 | * Returns Error Value in PCEP-ERROR Object.
|
| 59 | *
|
| 60 | * @return list of Error Value in PCEP-ERROR Object
|
| 61 | */
|
| 62 | public LinkedList<Integer> getErrorValue();
|
| 63 |
|
| 64 | /**
|
| 65 | * Returns Error Type in PCEP-ERROR Object.
|
| 66 | *
|
| 67 | * @return list of Error Type in PCEP-ERROR Object
|
| 68 | */
|
| 69 | public LinkedList<Integer> getErrorType();
|
| 70 |
|
| 71 | /**
|
| 72 | * Builder interface with get and set functions to build ErrorInfo.
|
| 73 | */
|
| 74 | public interface Builder {
|
| 75 |
|
| 76 | /**
|
| 77 | * Builds ErrorInfo Object.
|
| 78 | *
|
| 79 | * @return ErrorInfo Object.
|
| 80 | */
|
| 81 | PcepErrorInfo build();
|
| 82 |
|
| 83 | /**
|
| 84 | * Returns list of PcepError.
|
| 85 | *
|
| 86 | * @return list of PcepError
|
| 87 | */
|
| 88 | LinkedList<PcepError> getPcepErrorList();
|
| 89 |
|
| 90 | /**
|
| 91 | * Sets PcepError lists and returns its builder.
|
| 92 | *
|
| 93 | * @param llPcepErrorList list of PcepError
|
| 94 | * @return builder by setting list of PcepError.
|
| 95 | */
|
| 96 | Builder setPcepErrorList(LinkedList<PcepError> llPcepErrorList);
|
| 97 | }
|
| 98 | }
|