blob: 9feeccc57258b403e532593b6f2fbea76fb1f0a9 [file] [log] [blame]
Sho SHIMIZU74361c12015-08-11 12:31:48 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Sho SHIMIZU74361c12015-08-11 12:31:48 -07003 *
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;
19
20import org.jboss.netty.buffer.ChannelBuffer;
21import org.onosproject.pcepio.exceptions.PcepParseException;
22import org.onosproject.pcepio.types.PcepObjectHeader;
23import org.onosproject.pcepio.types.PcepValueType;
24
25/**
26 * Abstraction of an entity providing PCEP RRO Object.
27 */
28public interface PcepRroObject {
29
30 /**
31 * Returns list of SubObjects.
32 *
33 * @return list of SubObjects
34 */
35 LinkedList<PcepValueType> getSubObjects();
36
37 /**
38 * Sets list of SubObjects and return its builder.
39 *
40 * @param llSubObjects list of SubObjects
41 */
42 void setSubObjects(LinkedList<PcepValueType> llSubObjects);
43
44 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -070045 * Writes the RRO Object into channel buffer.
46 *
47 * @param bb channel buffer
48 * @return Returns the writerIndex of this buffer
49 * @throws PcepParseException when object header failed to write in channel buffer
50 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070051 int write(ChannelBuffer bb) throws PcepParseException;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070052
53 /**
54 * Builder interface with get and set functions to build RRO object.
55 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070056 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -070057
58 /**
59 * Builds RRO Object.
60 *
61 * @return RRO Object
62 */
63 PcepRroObject build();
64
65 /**
66 * Returns RRO object header.
67 *
68 * @return RRO object header
69 */
70 PcepObjectHeader getRroObjHeader();
71
72 /**
73 * Sets RRO object header and returns its builder.
74 *
75 * @param obj RRO object header
76 * @return Builder by setting RRO object header
77 */
78 Builder setRroObjHeader(PcepObjectHeader obj);
79
80 /**
81 * Returns list of SubObjects.
82 *
83 * @return list of SubObjects
84 */
85 LinkedList<PcepValueType> getSubObjects();
86
87 /**
88 * Sets list of SubObjects in RRO Object and returns its builder.
89 *
90 * @param llSubObjects list of SubObjects
91 * @return Builder by setting list of SubObjects
92 */
93 Builder setSubObjects(LinkedList<PcepValueType> llSubObjects);
94
95 /**
96 * Sets P flag in RRO object header and returns its builder.
97 *
98 * @param value boolean value to set P flag
99 * @return Builder by setting P flag
100 */
101 Builder setPFlag(boolean value);
102
103 /**
104 * Sets I flag in RRO object header and returns its builder.
105 *
106 * @param value boolean value to set I flag
107 * @return Builder by setting I flag
108 */
109 Builder setIFlag(boolean value);
110 }
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -0700111}