Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame^] | 1 | /*
|
| 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 | package org.onosproject.pcepio.protocol;
|
| 17 |
|
| 18 | import java.util.LinkedList;
|
| 19 | import org.jboss.netty.buffer.ChannelBuffer;
|
| 20 | import org.onosproject.pcepio.exceptions.PcepParseException;
|
| 21 | import org.onosproject.pcepio.types.PcepObjectHeader;
|
| 22 | import org.onosproject.pcepio.types.PcepValueType;
|
| 23 |
|
| 24 | /**
|
| 25 | * Abstraction of an entity providing PCEP IRO Object.
|
| 26 | */
|
| 27 | public 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 | }
|