blob: b8ab9ec8733dabcdc3c4f43bc5c56eddce0d65fb [file] [log] [blame]
Sho SHIMIZU74361c12015-08-11 12:31:48 -07001/*
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
17package org.onosproject.pcepio.protocol;
18
19import org.jboss.netty.buffer.ChannelBuffer;
20import org.onosproject.pcepio.exceptions.PcepParseException;
21
22/**
23 * Abstraction of an entity provides State Report for PCEP Report Message.
24 */
25public interface PcepStateReport {
26
27 /**
28 * Provides PCEP Message path for report message.
29 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070030 interface PcepMsgPath {
Sho SHIMIZU74361c12015-08-11 12:31:48 -070031
32 /**
33 * Returns PcepEroObject.
34 *
35 * @return eroObj
36 */
37 PcepEroObject getEroObject();
38
39 /**
40 * Sets PcepEroObject.
41 *
42 * @param eroObject Ero Object
43 */
44 void setEroObject(PcepEroObject eroObject);
45
46 /**
47 * Returns PcepAttribute.
48 *
49 * @return attrList
50 */
51 PcepAttribute getPcepAttribute();
52
53 /**
54 * Sets PcepAttribute.
55 *
56 * @param pcepAttribute Pcep Attribute object
57 */
58 void setPcepAttribute(PcepAttribute pcepAttribute);
59
60 /**
61 * Returns PcepRroObject.
62 *
63 * @return rroObj
64 */
65 PcepRroObject getRroObject();
66
67 /**
68 * Sets PcepRroObject.
69 *
70 * @param rroObject Rro object
71 */
72 void setRroObject(PcepRroObject rroObject);
73
74 /**
75 * Returns PcepBandwidthObject.
76 *
77 * @return bandwidth object
78 */
79 PcepBandwidthObject getBandwidthObject();
80
81 /**
82 * Sets PcepBandwidthObject.
83 *
84 * @param bandwidth bandwidth object
85 */
86 void setBandwidthObject(PcepBandwidthObject bandwidth);
87
88 /**
89 * Reads all the Objects for PCEP Message Path.
90 *
91 * @param bb of type channel buffer
92 * @return PCEP Message path
93 * @throws PcepParseException when invalid buffer received
94 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070095 PcepMsgPath read(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070096
97 /**
98 * Writes all the objects for pcep message path.
99 *
100 * @param bb of type channel buffer.
101 * @return object length index
102 * @throws PcepParseException when mandatory object is not set
103 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -0700104 int write(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700105 }
106
107 /**
108 * Returns PcepSrpObject.
109 *
110 * @return srpObject
111 */
112 PcepSrpObject getSrpObject();
113
114 /**
115 * Returns PcepLspObject.
116 *
117 * @return lspObject
118 */
119 PcepLspObject getLspObject();
120
121 /**
122 * Returns PcepMsgPath.
123 *
124 * @return msgPath
125 */
126 PcepMsgPath getMsgPath();
127
128 /**
129 * Sets the SRP Object.
130 *
131 * @param srpObj Pcep Srp Object
132 */
133 void setSrpObject(PcepSrpObject srpObj);
134
135 /**
136 * Sets the LSP Object.
137 *
138 * @param lspObject Pcep Lsp Object
139 */
140 void setLspObject(PcepLspObject lspObject);
141
142 /**
143 * Sets the Path Object.
144 *
145 * @param msgPath Pcep MsgPath object
146 */
147 void setMsgPath(PcepMsgPath msgPath);
148
149 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700150 * Builder interface with get and set functions to build PcepStateReport.
151 */
Sho SHIMIZU9bdb5ca2015-09-04 15:23:31 -0700152 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700153
154 /**
155 * Builds PcepStateReport.
156 *
157 * @return PcepStateReport
158 * @throws PcepParseException when mandatory object is not set
159 */
160 PcepStateReport build() throws PcepParseException;
161
162 /**
163 * Returns PcepSrpObject.
164 *
165 * @return srpObject
166 */
167 PcepSrpObject getSrpObject();
168
169 /**
170 * Returns PcepLspObject.
171 *
172 * @return lspObject
173 */
174 PcepLspObject getLspObject();
175
176 /**
177 * Returns PcepMsgPath.
178 *
179 * @return msgPath
180 */
181 PcepMsgPath getMsgPath();
182
183 /**
184 * Sets the SRP Object.
185 *
186 * @param srpObj Pcep Srp Object
187 * @return builder by setting PcepSrpObject
188 */
189 Builder setSrpObject(PcepSrpObject srpObj);
190
191 /**
192 * Sets the LSP Object.
193 *
194 * @param lspObject Pcep Lsp Object
195 * @return builder by setting PcepLspObject
196 */
197 Builder setLspObject(PcepLspObject lspObject);
198
199 /**
200 * Sets the Path Object.
201 *
202 * @param msgPath Pcep MsgPath object
203 * @return builder by setting PcepMsgPath
204 */
205 Builder setMsgPath(PcepMsgPath msgPath);
206 }
207}