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