blob: a1c1fc5926c6764fecdae2d4483aa45328e1cb47 [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 */
16package org.onosproject.pcepio.protocol;
17
18import java.util.LinkedList;
19import org.jboss.netty.buffer.ChannelBuffer;
20import org.onosproject.pcepio.exceptions.PcepParseException;
21import org.onosproject.pcepio.types.PcepObjectHeader;
22import org.onosproject.pcepio.types.PcepValueType;
23
24/**
25 * Abstraction of an entity providing PCEP IRO Object.
26 */
27public interface PcepIroObject {
28
29 /**
30 * Returns list of SubObjects.
31 *
32 * @return list of SubObjects
33 */
34 LinkedList<PcepValueType> getSubObjects();
35
36 /**
37 * Sets list of SubObjects.
38 *
39 * @param llSubObjects list of SubObjects
40 */
41 void setSubObjects(LinkedList<PcepValueType> llSubObjects);
42
43 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -070044 * Writes the IRO into channel buffer.
45 *
46 * @param bb channel buffer
47 * @return Returns the writerIndex of this buffer
48 * @throws PcepParseException while writing IRO object.
49 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070050 int write(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070051
52 /**
53 * Builder interface with get and set functions to build IRO object.
54 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070055 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -070056
57 /**
58 * Builds IRO Object.
59 *
60 * @return IRO Object
61 */
62 PcepIroObject build();
63
64 /**
65 * Returns IRO object header.
66 *
67 * @return IRO object header
68 */
69 PcepObjectHeader getIroObjHeader();
70
71 /**
72 * Sets IRO object header and returns its builder.
73 *
74 * @param obj IRO object header
75 * @return Builder by setting IRO object header
76 */
77 Builder setIroObjHeader(PcepObjectHeader obj);
78
79 /**
80 * Returns list of SubObjects.
81 *
82 * @return list of SubObjects
83 */
84 LinkedList<PcepValueType> getSubObjects();
85
86 /**
87 * Sets list of SubObjects in IRO Object and returns its builder.
88 *
89 * @param llSubObjects list of SubObjects
90 * @return Builder by setting list of SubObjects
91 */
92 Builder setSubObjects(LinkedList<PcepValueType> llSubObjects);
93
94 /**
95 * Sets P flag in IRO object header and returns its builder.
96 *
97 * @param value boolean value to set P flag
98 * @return Builder by setting P flag
99 */
100 Builder setPFlag(boolean value);
101
102 /**
103 * Sets I flag in IRO object header and returns its builder.
104 *
105 * @param value boolean value to set I flag
106 * @return Builder by setting I flag
107 */
108 Builder setIFlag(boolean value);
109 }
110}