blob: a8c80a91eccafa680717735db3ee855f56cc9e39 [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 */
16
17package org.onosproject.pcepio.protocol;
18
19import org.jboss.netty.buffer.ChannelBuffer;
20import org.onosproject.pcepio.exceptions.PcepParseException;
21import org.onosproject.pcepio.types.PcepObjectHeader;
22
23/**
24 * Abstraction of an entity providing PCEP End Points Object.
25 */
26public interface PcepEndPointsObject {
27
28 /**
29 * Returns Source IpAddress from End Points Object.
30 *
31 * @return Source IpAddress from End Points Object
32 */
33 int getSourceIpAddress();
34
35 /**
36 * Sets Source IpAddress in End Points Object.
37 *
38 * @param sourceIpAddress Source IP Address
39 */
40 void setSourceIpAddress(int sourceIpAddress);
41
42 /**
43 * Returns Destination IpAddress from End Points Object.
44 *
45 * @return Destination IpAddress from End Points Object
46 */
47 int getDestIpAddress();
48
49 /**
50 * Sets Destination IpAddress in End Points Object.
51 *
52 * @param destIpAddress Destination IP Address
53 */
54 void setDestIpAddress(int destIpAddress);
55
56 /**
57 * Prints attributes of EndPoints object.
58 */
59 void print();
60
61 /**
62 * Writes the EndPointsObject into channel buffer.
63 *
64 * @param bb channel buffer
65 * @return Returns the writerIndex of this buffer
66 * @throws PcepParseException while writing EndPointObject into ChannelBuffer
67 */
68 int write(ChannelBuffer bb) throws PcepParseException;
69
70 /**
71 * Builder interface with get and set functions to build EndPoints object.
72 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -070073 interface Builder {
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053074
75 /**
76 * Builds End Points Object.
77 *
78 * @return End Points Object
79 * @throws PcepParseException while building EndPointObject
80 */
81 PcepEndPointsObject build() throws PcepParseException;
82
83 /**
84 * Returns End Points Object header.
85 *
86 * @return End Points Object header
87 */
88 PcepObjectHeader getEndPointsObjHeader();
89
90 /**
91 * Sets End Points Object header and returns its builder.
92 *
93 * @param obj End Points Object header
94 * @return Builder by setting End Points Object header
95 */
96 Builder setEndPointsObjHeader(PcepObjectHeader obj);
97
98 /**
99 * Returns Source IpAddress from End Points Object.
100 *
101 * @return Source IpAddress from End Points Object
102 */
103 int getSourceIpAddress();
104
105 /**
106 * Sets Source IpAddress in End Points Object and returns builder.
107 *
108 * @param sourceIpAddress Source IP Address
109 * @return Builder by setting Source IpAddress in End Points Object
110 */
111 Builder setSourceIpAddress(int sourceIpAddress);
112
113 /**
114 * Returns Destination IpAddress from End Points Object.
115 *
116 * @return Destination IpAddress from End Points Object
117 */
118 int getDestIpAddress();
119
120 /**
121 * Sets Destination IpAddress in End Points Object.
122 *
123 * @param destIpAddress Destination IP Address
124 * @return Builder by setting Destination IpAddress in End Points Object
125 */
126 Builder setDestIpAddress(int destIpAddress);
127
128 /**
129 * Sets P flag in Bandwidth object header and returns its builder.
130 *
131 * @param value boolean value to set P flag
132 * @return Builder by setting P flag
133 */
134 Builder setPFlag(boolean value);
135
136 /**
137 * Sets I flag in Bandwidth object header and returns its builder.
138 *
139 * @param value boolean value to set I flag
140 * @return Builder by setting I flag
141 */
142 Builder setIFlag(boolean value);
143 }
144}