Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.pcepio.protocol; |
| 18 | |
| 19 | import org.jboss.netty.buffer.ChannelBuffer; |
| 20 | import org.onosproject.pcepio.exceptions.PcepParseException; |
| 21 | import org.onosproject.pcepio.types.PcepObjectHeader; |
| 22 | |
| 23 | /** |
| 24 | * Abstraction of an entity providing PCEP FEC Object of Type 1 IPv4 Node ID. |
| 25 | */ |
| 26 | public interface PcepFecObjectIPv4 extends PcepFecObject { |
| 27 | |
| 28 | /** |
| 29 | * Returns NodeID of FEC Object. |
| 30 | * |
| 31 | * @return NodeID of FEC Object |
| 32 | */ |
| 33 | int getNodeID(); |
| 34 | |
| 35 | /** |
| 36 | * Sets NodeID with specified value. |
| 37 | * |
| 38 | * @param value node id |
| 39 | */ |
| 40 | void setNodeID(int value); |
| 41 | |
| 42 | @Override |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 43 | int write(ChannelBuffer bb) throws PcepParseException; |
| 44 | |
| 45 | /** |
| 46 | * Builder interface with get and set functions to build FEC object. |
| 47 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 48 | interface Builder { |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 49 | |
| 50 | /** |
| 51 | * Builds FEC Object IPv4. |
| 52 | * |
| 53 | * @return FEC Object IPv4 |
| 54 | * @throws PcepParseException while creating FEC IPv4 Object. |
| 55 | */ |
| 56 | PcepFecObjectIPv4 build() throws PcepParseException; |
| 57 | |
| 58 | /** |
| 59 | * Returns FEC Object IPv4 header. |
| 60 | * |
| 61 | * @return FEC Object IPv4 header |
| 62 | */ |
| 63 | PcepObjectHeader getFecIpv4ObjHeader(); |
| 64 | |
| 65 | /** |
| 66 | * Sets FEC Object IPv4 header and returns its builder. |
| 67 | * |
| 68 | * @param obj FEC Object IPv4 header |
| 69 | * @return Builder by setting FEC Object IPv4 header |
| 70 | */ |
| 71 | Builder setFecIpv4ObjHeader(PcepObjectHeader obj); |
| 72 | |
| 73 | /** |
| 74 | * Returns NodeID of FEC Object. |
| 75 | * |
| 76 | * @return NodeID of FEC Object |
| 77 | */ |
| 78 | int getNodeID(); |
| 79 | |
| 80 | /** |
| 81 | * Sets NodeID and returns its builder. |
| 82 | * |
| 83 | * @param value node id |
| 84 | * @return builder by setting NodeID |
| 85 | */ |
| 86 | Builder setNodeID(int value); |
| 87 | |
| 88 | /** |
| 89 | * Sets P flag in FEC object header and returns its builder. |
| 90 | * |
| 91 | * @param value boolean value to set P flag |
| 92 | * @return Builder by setting P flag |
| 93 | */ |
| 94 | Builder setPFlag(boolean value); |
| 95 | |
| 96 | /** |
| 97 | * Sets I flag in FEC object header and returns its builder. |
| 98 | * |
| 99 | * @param value boolean value to set I flag |
| 100 | * @return Builder by setting I flag |
| 101 | */ |
| 102 | Builder setIFlag(boolean value); |
| 103 | } |
| 104 | } |