blob: 9cd5f92730582dc8ba4d047edbce9b8d1e717e2e [file] [log] [blame]
Sho SHIMIZU74361c12015-08-11 12:31:48 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Sho SHIMIZU74361c12015-08-11 12:31:48 -07003 *
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 org.jboss.netty.buffer.ChannelBuffer;
19import org.onosproject.pcepio.exceptions.PcepParseException;
20import org.onosproject.pcepio.types.PcepLabelDownload;
21import org.onosproject.pcepio.types.PcepLabelMap;
22
23/***
24 * Abstraction to provide PCEP Label Updates.
25 */
26public 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 SHIMIZU260f6ef2015-08-11 13:53:31 -070034 void write(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070035
36 /**
37 * Sets the Label Download object.
38 *
39 * @param labelDownload PCEP Label Download object
40 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070041 void setLabelDownload(PcepLabelDownload labelDownload);
Sho SHIMIZU74361c12015-08-11 12:31:48 -070042
43 /**
44 * Returns the PcepLabelDownload object.
45 *
46 * @return labelDownload PCEP Label Download
47 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070048 PcepLabelDownload getLabelDownload();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070049
50 /**
51 * Sets the Label map object.
52 *
53 * @param labelMap PCEP Label Map object
54 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070055 void setLabelMap(PcepLabelMap labelMap);
Sho SHIMIZU74361c12015-08-11 12:31:48 -070056
57 /**
58 * Returns the PcepLabelMap object.
59 *
60 * @return labelMap PCEP Label Map
61 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070062 PcepLabelMap getLabelMap();
Sho SHIMIZU74361c12015-08-11 12:31:48 -070063
64 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -070065 * Builder interface with get and set functions to build Label Update message.
66 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070067 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -070068
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}