blob: 4b1d50a5ac7b02f5df1730f0d2757cbf4a9e93d1 [file] [log] [blame]
bharat saraswale1806302015-08-21 12:16:46 +05301/*
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 */
Sho SHIMIZU74361c12015-08-11 12:31:48 -070016package org.onosproject.pcepio.protocol;
17
18import org.jboss.netty.buffer.ChannelBuffer;
19import org.onosproject.pcepio.exceptions.PcepParseException;
20
21/**
22 * Abstraction of an entity Provides PCEP Message PAth for update message.
23 * Reference :PCE extensions for stateful draft-ietf-pce-stateful-pce-10.
24 */
25public interface PcepMsgPath {
26
27 /**
28 * Returns object of PcepEroObject.
29 *
30 * @return eroObject
31 */
32 PcepEroObject getEroObject();
33
34 /**
35 * Returns object of PcepAttribute.
36 *
37 * @return pcepAttribute
38 */
39 PcepAttribute getPcepAttribute();
40
41 /**
42 * Sets PcepEroObject.
43 *
44 * @param eroObject PCEP ERO Object.
45 */
46 void setEroObject(PcepEroObject eroObject);
47
48 /**
49 * Sets PcepAttribute.
50 *
51 * @param pcepAttribute PCEP-Attribute.
52 */
53 void setPcepAttribute(PcepAttribute pcepAttribute);
54
55 /**
56 * reads ERO object and attribute list.
57 *
58 * @param bb of type channel buffer
59 * @return PcepMsgPath
60 * @throws PcepParseException while parsing Message Path from Channel Buffer.
61 */
Sho SHIMIZU9bdb5ca2015-09-04 15:23:31 -070062 PcepMsgPath read(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070063
64 /**
65 * writes ERO object and attribute list to channel.
66 *
67 * @param bb of type channel buffer
68 * @return object length index
69 * @throws PcepParseException while writing Message Path into Channel Buffer.
70 */
71
Sho SHIMIZU9bdb5ca2015-09-04 15:23:31 -070072 int write(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070073
74 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -070075 * Builder interface with get and set functions to build PcepMsgPath.
76 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070077 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -070078
79 /**
80 * Builds PcepMsgPath.
81 *
82 * @return PcepMsgPath
83 * @throws PcepParseException when mandatory object is not set
84 */
85 PcepMsgPath build() throws PcepParseException;
86
87 /**
88 * Returns object of PcepEroObject.
89 *
90 * @return PcepEroObject
91 */
92 PcepEroObject getEroObject();
93
94 /**
95 * Returns object of PcepAttribute.
96 *
97 * @return pcepAttribute
98 */
99 PcepAttribute getPcepAttribute();
100
101 /**
102 * Sets PcepEroObject.
103 *
104 * @param eroObject PcepEroObject
105 * @return Builder by setting ERO object.
106 */
107 Builder setEroObject(PcepEroObject eroObject);
108
109 /**
110 * Sets PcepAttribute.
111 *
112 * @param pcepAttribute PCEP-Attribute
113 * @return Builder by setting PCEP-Attribute.
114 */
115 Builder setPcepAttribute(PcepAttribute pcepAttribute);
116 }
117}