blob: 3db19b9d02ec43454e256fb96a686b4b0d740e24 [file] [log] [blame]
Phaneendra Manda1c0061d2015-08-06 12:29:38 +05301/*
2 * Copyright 2014 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 */
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 */
34 public void write(ChannelBuffer bb) throws PcepParseException;
35
36 /**
37 * Sets the Label Download object.
38 *
39 * @param labelDownload PCEP Label Download object
40 */
41 public void setLabelDownload(PcepLabelDownload labelDownload);
42
43 /**
44 * Returns the PcepLabelDownload object.
45 *
46 * @return labelDownload PCEP Label Download
47 */
48 public PcepLabelDownload getLabelDownload();
49
50 /**
51 * Sets the Label map object.
52 *
53 * @param labelMap PCEP Label Map object
54 */
55 public void setLabelMap(PcepLabelMap labelMap);
56
57 /**
58 * Returns the PcepLabelMap object.
59 *
60 * @return labelMap PCEP Label Map
61 */
62 public PcepLabelMap getLabelMap();
63
64 /**
65 * Prints the attributes of PCEP Label update.
66 */
67 public void print();
68
69 /**
70 * Builder interface with get and set functions to build Label Update message.
71 */
72 public interface Builder {
73
74 /**
75 * Builds PcepLableUpdate Object.
76 *
77 * @return PcepLableUpdate Object
78 * @throws PcepParseException while building LABEL-UPDATE.
79 */
80 PcepLabelUpdate build() throws PcepParseException;
81
82 /**
83 * Sets the Label Download object.
84 *
85 * @param labelDownload PCEP Label Download object
86 * @return Builder by setting labelDownload object
87 */
88 Builder setLabelDownload(PcepLabelDownload labelDownload);
89
90 /**
91 * Returns the PcepLabelDownload object.
92 *
93 * @return labelDownload PCEP Label Download
94 */
95 PcepLabelDownload getLabelDownload();
96
97 /**
98 * Sets the Label map object.
99 *
100 * @param labelMap PCEP Label Map object
101 * @return Builder by setting PcepLabelMap object
102 */
103 Builder setLabelMap(PcepLabelMap labelMap);
104
105 /**
106 * Returns the PcepLabelMap object.
107 *
108 * @return labelMap PCEP Label Map
109 */
110 PcepLabelMap getLabelMap();
111 }
112
113}