Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 1 | /* |
Phaneendra Manda | 5518067 | 2015-08-25 23:42:55 +0530 | [diff] [blame] | 2 | * Copyright 2015 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 | package org.onosproject.pcepio.protocol; |
| 17 | |
| 18 | import org.jboss.netty.buffer.ChannelBuffer; |
| 19 | import org.onosproject.pcepio.exceptions.PcepParseException; |
| 20 | import org.onosproject.pcepio.types.PcepLabelDownload; |
| 21 | import org.onosproject.pcepio.types.PcepLabelMap; |
| 22 | |
| 23 | /*** |
| 24 | * Abstraction to provide PCEP Label Updates. |
| 25 | */ |
| 26 | public interface PcepLabelUpdate { |
| 27 | |
| 28 | /** |
| 29 | * Writes the byte stream of PcepLabelUpdate into channel buffer. |
| 30 | * |
| 31 | * @param bb of type channel buffer |
| 32 | * @throws PcepParseException while writing LABEL UPDATE. |
| 33 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 34 | void write(ChannelBuffer bb) throws PcepParseException; |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Sets the Label Download object. |
| 38 | * |
| 39 | * @param labelDownload PCEP Label Download object |
| 40 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 41 | void setLabelDownload(PcepLabelDownload labelDownload); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * Returns the PcepLabelDownload object. |
| 45 | * |
| 46 | * @return labelDownload PCEP Label Download |
| 47 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 48 | PcepLabelDownload getLabelDownload(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
| 51 | * Sets the Label map object. |
| 52 | * |
| 53 | * @param labelMap PCEP Label Map object |
| 54 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 55 | void setLabelMap(PcepLabelMap labelMap); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Returns the PcepLabelMap object. |
| 59 | * |
| 60 | * @return labelMap PCEP Label Map |
| 61 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 62 | PcepLabelMap getLabelMap(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 63 | |
| 64 | /** |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 65 | * Builder interface with get and set functions to build Label Update message. |
| 66 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 67 | interface Builder { |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Builds PcepLableUpdate Object. |
| 71 | * |
| 72 | * @return PcepLableUpdate Object |
| 73 | * @throws PcepParseException while building LABEL-UPDATE. |
| 74 | */ |
| 75 | PcepLabelUpdate build() throws PcepParseException; |
| 76 | |
| 77 | /** |
| 78 | * Sets the Label Download object. |
| 79 | * |
| 80 | * @param labelDownload PCEP Label Download object |
| 81 | * @return Builder by setting labelDownload object |
| 82 | */ |
| 83 | Builder setLabelDownload(PcepLabelDownload labelDownload); |
| 84 | |
| 85 | /** |
| 86 | * Returns the PcepLabelDownload object. |
| 87 | * |
| 88 | * @return labelDownload PCEP Label Download |
| 89 | */ |
| 90 | PcepLabelDownload getLabelDownload(); |
| 91 | |
| 92 | /** |
| 93 | * Sets the Label map object. |
| 94 | * |
| 95 | * @param labelMap PCEP Label Map object |
| 96 | * @return Builder by setting PcepLabelMap object |
| 97 | */ |
| 98 | Builder setLabelMap(PcepLabelMap labelMap); |
| 99 | |
| 100 | /** |
| 101 | * Returns the PcepLabelMap object. |
| 102 | * |
| 103 | * @return labelMap PCEP Label Map |
| 104 | */ |
| 105 | PcepLabelMap getLabelMap(); |
| 106 | } |
| 107 | |
| 108 | } |