blob: 672677bf7b0227cf46f2a7dfc25b6d18b2bfda7e [file] [log] [blame]
Phaneendra Manda1c0061d2015-08-06 12:29:38 +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 */
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 /**
44 * Prints attributes of IRO object.
45 */
46 void print();
47
48 /**
49 * Writes the IRO into channel buffer.
50 *
51 * @param bb channel buffer
52 * @return Returns the writerIndex of this buffer
53 * @throws PcepParseException while writing IRO object.
54 */
55 public int write(ChannelBuffer bb) throws PcepParseException;
56
57 /**
58 * Builder interface with get and set functions to build IRO object.
59 */
60 public interface Builder {
61
62 /**
63 * Builds IRO Object.
64 *
65 * @return IRO Object
66 */
67 PcepIroObject build();
68
69 /**
70 * Returns IRO object header.
71 *
72 * @return IRO object header
73 */
74 PcepObjectHeader getIroObjHeader();
75
76 /**
77 * Sets IRO object header and returns its builder.
78 *
79 * @param obj IRO object header
80 * @return Builder by setting IRO object header
81 */
82 Builder setIroObjHeader(PcepObjectHeader obj);
83
84 /**
85 * Returns list of SubObjects.
86 *
87 * @return list of SubObjects
88 */
89 LinkedList<PcepValueType> getSubObjects();
90
91 /**
92 * Sets list of SubObjects in IRO Object and returns its builder.
93 *
94 * @param llSubObjects list of SubObjects
95 * @return Builder by setting list of SubObjects
96 */
97 Builder setSubObjects(LinkedList<PcepValueType> llSubObjects);
98
99 /**
100 * Sets P flag in IRO object header and returns its builder.
101 *
102 * @param value boolean value to set P flag
103 * @return Builder by setting P flag
104 */
105 Builder setPFlag(boolean value);
106
107 /**
108 * Sets I flag in IRO object header and returns its builder.
109 *
110 * @param value boolean value to set I flag
111 * @return Builder by setting I flag
112 */
113 Builder setIFlag(boolean value);
114 }
115}