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 | */ |
| 16 | |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 17 | package org.onosproject.pcepio.protocol; |
| 18 | |
| 19 | import org.jboss.netty.buffer.ChannelBuffer; |
bharat saraswal | e180630 | 2015-08-21 12:16:46 +0530 | [diff] [blame] | 20 | import org.onosproject.pcepio.exceptions.PcepParseException; |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 21 | import org.onosproject.pcepio.types.ErrorObjListWithOpen; |
| 22 | |
| 23 | /** |
| 24 | * Abstraction of an entity providing PCEP Error Message. |
| 25 | */ |
| 26 | public interface PcepErrorMsg extends PcepMessage { |
| 27 | |
| 28 | @Override |
| 29 | PcepVersion getVersion(); |
| 30 | |
| 31 | @Override |
| 32 | PcepType getType(); |
| 33 | |
| 34 | /** |
| 35 | * Returns Object of ErrorObjListWithOpen. |
| 36 | * |
| 37 | * @return Object of ErrorObjListWithOpen |
| 38 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 39 | ErrorObjListWithOpen getErrorObjListWithOpen(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 40 | |
| 41 | /** |
| 42 | * Sets errObjListWithOpen object. |
| 43 | * |
| 44 | * @param errObjListWithOpen error object List with open object |
| 45 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 46 | void setErrorObjListWithOpen(ErrorObjListWithOpen errObjListWithOpen); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * Returns Object of PcepErrorInfo. |
| 50 | * |
| 51 | * @return Object of PcepErrorInfo |
| 52 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 53 | PcepErrorInfo getPcepErrorInfo(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 54 | |
| 55 | /** |
| 56 | * Sets errInfo Object. |
| 57 | * |
| 58 | * @param errInfo error information |
| 59 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 60 | void setPcepErrorInfo(PcepErrorInfo errInfo); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 61 | |
| 62 | @Override |
bharat saraswal | e180630 | 2015-08-21 12:16:46 +0530 | [diff] [blame] | 63 | void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 64 | |
| 65 | /** |
| 66 | * Builder interface with get and set functions to build PCEP Error message. |
| 67 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 68 | interface Builder extends PcepMessage.Builder { |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 69 | |
| 70 | @Override |
| 71 | PcepErrorMsg build(); |
| 72 | |
| 73 | @Override |
| 74 | PcepVersion getVersion(); |
| 75 | |
| 76 | @Override |
| 77 | PcepType getType(); |
| 78 | |
| 79 | /** |
| 80 | * Returns Object of ErrorObjListWithOpen. |
| 81 | * |
| 82 | * @return Object of ErrorObjListWithOpen |
| 83 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 84 | ErrorObjListWithOpen getErrorObjListWithOpen(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * Sets errObjListWithOpen object. |
| 88 | * |
| 89 | * @param errObjListWithOpen error object with open object |
| 90 | * @return builder by setting Object of ErrorObjListWithOpen |
| 91 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 92 | Builder setErrorObjListWithOpen(ErrorObjListWithOpen errObjListWithOpen); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 93 | |
| 94 | /** |
| 95 | * Returns Object of PcepErrorInfo. |
| 96 | * |
| 97 | * @return Object of PcepErrorInfo |
| 98 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 99 | PcepErrorInfo getPcepErrorInfo(); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 100 | |
| 101 | /** |
| 102 | * Sets errInfo Object. |
| 103 | * |
| 104 | * @param errInfo error information |
| 105 | * @return builder by getting Object of PcepErrorInfo |
| 106 | */ |
Sho SHIMIZU | 260f6ef | 2015-08-11 13:53:31 -0700 | [diff] [blame] | 107 | Builder setPcepErrorInfo(PcepErrorInfo errInfo); |
Sho SHIMIZU | 74361c1 | 2015-08-11 12:31:48 -0700 | [diff] [blame] | 108 | } |
| 109 | } |