Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 1 | package org.onosproject.pcepio.protocol; |
| 2 | |
| 3 | import org.jboss.netty.buffer.ChannelBuffer; |
| 4 | import org.onosproject.pcepio.exceptions.PcepParseException; |
| 5 | |
| 6 | /** |
| 7 | * Abstraction of an entity Provides PCEP Message PAth for update message. |
| 8 | * Reference :PCE extensions for stateful draft-ietf-pce-stateful-pce-10. |
| 9 | */ |
| 10 | public interface PcepMsgPath { |
| 11 | |
| 12 | /** |
| 13 | * Returns object of PcepEroObject. |
| 14 | * |
| 15 | * @return eroObject |
| 16 | */ |
| 17 | PcepEroObject getEroObject(); |
| 18 | |
| 19 | /** |
| 20 | * Returns object of PcepAttribute. |
| 21 | * |
| 22 | * @return pcepAttribute |
| 23 | */ |
| 24 | PcepAttribute getPcepAttribute(); |
| 25 | |
| 26 | /** |
| 27 | * Sets PcepEroObject. |
| 28 | * |
| 29 | * @param eroObject PCEP ERO Object. |
| 30 | */ |
| 31 | void setEroObject(PcepEroObject eroObject); |
| 32 | |
| 33 | /** |
| 34 | * Sets PcepAttribute. |
| 35 | * |
| 36 | * @param pcepAttribute PCEP-Attribute. |
| 37 | */ |
| 38 | void setPcepAttribute(PcepAttribute pcepAttribute); |
| 39 | |
| 40 | /** |
| 41 | * reads ERO object and attribute list. |
| 42 | * |
| 43 | * @param bb of type channel buffer |
| 44 | * @return PcepMsgPath |
| 45 | * @throws PcepParseException while parsing Message Path from Channel Buffer. |
| 46 | */ |
| 47 | public PcepMsgPath read(ChannelBuffer bb) throws PcepParseException; |
| 48 | |
| 49 | /** |
| 50 | * writes ERO object and attribute list to channel. |
| 51 | * |
| 52 | * @param bb of type channel buffer |
| 53 | * @return object length index |
| 54 | * @throws PcepParseException while writing Message Path into Channel Buffer. |
| 55 | */ |
| 56 | |
| 57 | public int write(ChannelBuffer bb) throws PcepParseException; |
| 58 | |
| 59 | /** |
| 60 | * Prints the attributes of PCEP message path. |
| 61 | */ |
| 62 | void print(); |
| 63 | |
| 64 | /** |
| 65 | * Builder interface with get and set functions to build PcepMsgPath. |
| 66 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame^] | 67 | interface Builder { |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Builds PcepMsgPath. |
| 71 | * |
| 72 | * @return PcepMsgPath |
| 73 | * @throws PcepParseException when mandatory object is not set |
| 74 | */ |
| 75 | PcepMsgPath build() throws PcepParseException; |
| 76 | |
| 77 | /** |
| 78 | * Returns object of PcepEroObject. |
| 79 | * |
| 80 | * @return PcepEroObject |
| 81 | */ |
| 82 | PcepEroObject getEroObject(); |
| 83 | |
| 84 | /** |
| 85 | * Returns object of PcepAttribute. |
| 86 | * |
| 87 | * @return pcepAttribute |
| 88 | */ |
| 89 | PcepAttribute getPcepAttribute(); |
| 90 | |
| 91 | /** |
| 92 | * Sets PcepEroObject. |
| 93 | * |
| 94 | * @param eroObject PcepEroObject |
| 95 | * @return Builder by setting ERO object. |
| 96 | */ |
| 97 | Builder setEroObject(PcepEroObject eroObject); |
| 98 | |
| 99 | /** |
| 100 | * Sets PcepAttribute. |
| 101 | * |
| 102 | * @param pcepAttribute PCEP-Attribute |
| 103 | * @return Builder by setting PCEP-Attribute. |
| 104 | */ |
| 105 | Builder setPcepAttribute(PcepAttribute pcepAttribute); |
| 106 | } |
| 107 | } |