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 for PCEP error message.
|
| 25 | */
|
| 26 | public 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 | */
|
| 68 | public void setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList);
|
| 69 |
|
| 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 | */
|
| 77 | public int write(ChannelBuffer bb) throws PcepParseException;
|
| 78 |
|
| 79 | /**
|
| 80 | * Prints the attributes of PCEP Error.
|
| 81 | */
|
| 82 | public void print();
|
| 83 |
|
| 84 | /**
|
| 85 | * Builder interface with get and set functions to build PcepError.
|
| 86 | */
|
| 87 | public interface Builder {
|
| 88 |
|
| 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 | }
|