2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onosproject.pcepio.protocol;
19 import org.jboss.netty.buffer.ChannelBuffer;
20 import org.onosproject.pcepio.exceptions.PcepParseException;
21 import org.onosproject.pcepio.types.PcepObjectHeader;
24 * Abstraction of an entity providing PCEP End Points Object.
26 public interface PcepEndPointsObject {
29 * Returns Source IpAddress from End Points Object.
31 * @return Source IpAddress from End Points Object
33 int getSourceIpAddress();
36 * Sets Source IpAddress in End Points Object.
38 * @param sourceIpAddress Source IP Address
40 void setSourceIpAddress(int sourceIpAddress);
43 * Returns Destination IpAddress from End Points Object.
45 * @return Destination IpAddress from End Points Object
47 int getDestIpAddress();
50 * Sets Destination IpAddress in End Points Object.
52 * @param destIpAddress Destination IP Address
54 void setDestIpAddress(int destIpAddress);
57 * Writes the EndPointsObject into channel buffer.
59 * @param bb channel buffer
60 * @return Returns the writerIndex of this buffer
61 * @throws PcepParseException while writing EndPointObject into ChannelBuffer
63 int write(ChannelBuffer bb) throws PcepParseException;
66 * Builder interface with get and set functions to build EndPoints object.
71 * Builds End Points Object.
73 * @return End Points Object
74 * @throws PcepParseException while building EndPointObject
76 PcepEndPointsObject build() throws PcepParseException;
79 * Returns End Points Object header.
81 * @return End Points Object header
83 PcepObjectHeader getEndPointsObjHeader();
86 * Sets End Points Object header and returns its builder.
88 * @param obj End Points Object header
89 * @return Builder by setting End Points Object header
91 Builder setEndPointsObjHeader(PcepObjectHeader obj);
94 * Returns Source IpAddress from End Points Object.
96 * @return Source IpAddress from End Points Object
98 int getSourceIpAddress();
101 * Sets Source IpAddress in End Points Object and returns builder.
103 * @param sourceIpAddress Source IP Address
104 * @return Builder by setting Source IpAddress in End Points Object
106 Builder setSourceIpAddress(int sourceIpAddress);
109 * Returns Destination IpAddress from End Points Object.
111 * @return Destination IpAddress from End Points Object
113 int getDestIpAddress();
116 * Sets Destination IpAddress in End Points Object.
118 * @param destIpAddress Destination IP Address
119 * @return Builder by setting Destination IpAddress in End Points Object
121 Builder setDestIpAddress(int destIpAddress);
124 * Sets P flag in Bandwidth object header and returns its builder.
126 * @param value boolean value to set P flag
127 * @return Builder by setting P flag
129 Builder setPFlag(boolean value);
132 * Sets I flag in Bandwidth object header and returns its builder.
134 * @param value boolean value to set I flag
135 * @return Builder by setting I flag
137 Builder setIFlag(boolean value);