Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +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.bgpio.protocol; |
| 17 | |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 18 | import org.onosproject.bgpio.exceptions.BgpParseException; |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 19 | |
| 20 | /** |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 21 | * Abstraction of an entity providing BGP notification message. |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 22 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 23 | public interface BgpNotificationMsg extends BgpMessage { |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 24 | /** |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 25 | * Returns errorCode in notification message. |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 26 | * |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 27 | * @return errorCode in notification message |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 28 | */ |
| 29 | byte getErrorCode(); |
| 30 | |
| 31 | /** |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 32 | * Returns error subCode in notification message. |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 33 | * |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 34 | * @return error subCode in notification message |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 35 | */ |
| 36 | byte getErrorSubCode(); |
| 37 | |
| 38 | /** |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 39 | * Returns error data in notification message. |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 40 | * |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 41 | * @return error data in notification message |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 42 | */ |
| 43 | byte[] getData(); |
| 44 | |
| 45 | /** |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 46 | * Builder interface with get and set functions to build notification message. |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 47 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 48 | public interface Builder extends BgpMessage.Builder { |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 49 | |
| 50 | @Override |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 51 | BgpNotificationMsg build() throws BgpParseException; |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 52 | |
| 53 | /** |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 54 | * Sets errorCode in notification message and return its builder. |
| 55 | * |
| 56 | * @param errorCode in notification message |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 57 | * @return builder by setting errorCode in notification message |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 58 | */ |
| 59 | Builder setErrorCode(byte errorCode); |
| 60 | |
| 61 | /** |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 62 | * Sets error subCode in notification message and return its builder. |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 63 | * |
Priyanka B | 715854a | 2015-10-27 16:11:53 +0530 | [diff] [blame] | 64 | * @param errorSubCode in notification message |
| 65 | * @return builder by setting error subCode in notification message |
Priyanka B | 9aaa311 | 2015-10-09 17:19:33 +0530 | [diff] [blame] | 66 | */ |
| 67 | Builder setErrorSubCode(byte errorSubCode); |
| 68 | |
| 69 | /** |
| 70 | * Sets error data in notification message and return its builder. |
| 71 | * |
| 72 | * @param data in notification message |
| 73 | * @return builder by setting Data in notification message |
| 74 | */ |
| 75 | Builder setData(byte[] data); |
| 76 | } |
| 77 | } |