Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.pcepio.protocol; |
| 18 | |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 19 | import java.util.LinkedList; |
| 20 | |
| 21 | import org.jboss.netty.buffer.ChannelBuffer; |
| 22 | import org.onosproject.pcepio.exceptions.PcepParseException; |
| 23 | |
Phanendra Manda | 51fb9c2 | 2015-09-01 16:17:41 +0530 | [diff] [blame] | 24 | /** |
| 25 | * Abstraction of an entity which Provides List of PCEP Attributes. |
| 26 | */ |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 27 | public interface PcepAttribute { |
| 28 | |
| 29 | /** |
| 30 | * writes lspa , bandwidth , Metriclist and Iro objects to the channel. |
| 31 | * |
| 32 | * @param bb of type channel buffer. |
| 33 | * @return object length index. |
| 34 | * @throws PcepParseException while writing objects to channel buffer |
| 35 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 36 | int write(ChannelBuffer bb) throws PcepParseException; |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * Returns PcepLspaObject. |
| 40 | * |
| 41 | * @return LspaObject |
| 42 | */ |
| 43 | PcepLspaObject getLspaObject(); |
| 44 | |
| 45 | /** |
| 46 | * Returns PcepBandwidthObject. |
| 47 | * |
| 48 | * @return BandwidthObject |
| 49 | */ |
| 50 | PcepBandwidthObject getBandwidthObject(); |
| 51 | |
| 52 | /** |
| 53 | * Returns PcepIroObject. |
| 54 | * |
| 55 | * @return iroObject |
| 56 | */ |
| 57 | PcepIroObject getIroObject(); |
| 58 | |
| 59 | /** |
| 60 | * Sets the PcepBandwidthObject. |
| 61 | * |
| 62 | * @param bandwidthObject bandwidth object |
| 63 | */ |
| 64 | void setBandwidthObject(PcepBandwidthObject bandwidthObject); |
| 65 | |
| 66 | /** |
| 67 | * Sets the PcepLspaObject. |
| 68 | * |
| 69 | * @param lspaObject lspa object |
| 70 | */ |
| 71 | void setLspaObject(PcepLspaObject lspaObject); |
| 72 | |
| 73 | /** |
| 74 | * Sets the PcepIroObject. |
| 75 | * |
| 76 | * @param iroObject iro object |
| 77 | */ |
| 78 | void setIroObject(PcepIroObject iroObject); |
| 79 | |
| 80 | /** |
| 81 | * Returns PcepMetricObject List. |
| 82 | * |
| 83 | * @return list of metric objects |
| 84 | */ |
| 85 | LinkedList<PcepMetricObject> getMetricObjectList(); |
| 86 | |
| 87 | /** |
| 88 | * Sets PcepMetricObject List. |
| 89 | * |
| 90 | * @param llMetricList list of metric objects |
| 91 | */ |
| 92 | void setMetricObjectList(LinkedList<PcepMetricObject> llMetricList); |
| 93 | |
| 94 | /** |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 95 | * Builder interface with get and set functions to build PcepAttribute. |
| 96 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 97 | interface Builder { |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 98 | |
| 99 | /** |
| 100 | * Builds PcepAttribute. |
| 101 | * |
| 102 | * @return PcepAttribute |
| 103 | */ |
| 104 | PcepAttribute build(); |
| 105 | |
| 106 | /** |
| 107 | * Returns PcepLspaObject. |
| 108 | * |
| 109 | * @return LspaObject |
| 110 | */ |
| 111 | PcepLspaObject getLspaObject(); |
| 112 | |
| 113 | /** |
| 114 | * Returns PcepBandwidthObject. |
| 115 | * |
| 116 | * @return BandwidthObject |
| 117 | */ |
| 118 | PcepBandwidthObject getBandwidthObject(); |
| 119 | |
| 120 | /** |
| 121 | * Returns PcepIroObject. |
| 122 | * |
| 123 | * @return iroObject |
| 124 | */ |
| 125 | PcepIroObject getIroObject(); |
| 126 | |
| 127 | /** |
| 128 | * Sets the PcepBandwidthObject. |
| 129 | * |
| 130 | * @param bandwidthObject bandwidth object |
| 131 | * @return Builder object for PcepAttrubute |
| 132 | */ |
| 133 | Builder setBandwidthObject(PcepBandwidthObject bandwidthObject); |
| 134 | |
| 135 | /** |
| 136 | * Sets the PcepLspaObject. |
| 137 | * |
| 138 | * @param lspaObject lspa object |
| 139 | * @return Builder object for PcepAttrubute |
| 140 | */ |
| 141 | Builder setLspaObject(PcepLspaObject lspaObject); |
| 142 | |
| 143 | /** |
| 144 | * Sets the PcepIroObject. |
| 145 | * |
| 146 | * @param iroObject iro object |
| 147 | * @return Builder object for PcepAttrubute |
| 148 | */ |
| 149 | Builder setIroObject(PcepIroObject iroObject); |
| 150 | |
| 151 | /** |
| 152 | * Returns PcepMetricObject List. |
| 153 | * |
| 154 | * @return list of metric objects |
| 155 | */ |
| 156 | LinkedList<PcepMetricObject> getMetricObjectList(); |
| 157 | |
| 158 | /** |
| 159 | * Sets PcepMetricObject List. |
| 160 | * |
| 161 | * @param llMetricList list of metric objects |
| 162 | * @return Builder object for PcepAttrubute |
| 163 | */ |
| 164 | Builder setMetricObjectList(LinkedList<PcepMetricObject> llMetricList); |
| 165 | } |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 166 | } |