Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Laboratory |
Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.bgpio.protocol; |
| 18 | |
| 19 | /** |
| 20 | * Abstraction of an message factory providing builder functions to BGP messages |
| 21 | * and objects. |
| 22 | * |
| 23 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 24 | public interface BgpFactory { |
Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Gets the builder object for a open message. |
| 28 | * |
| 29 | * @return builder object for open message |
| 30 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 31 | BgpOpenMsg.Builder openMessageBuilder(); |
Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 32 | |
| 33 | /** |
| 34 | * Gets the builder object for a keepalive message. |
| 35 | * |
| 36 | * @return builder object for keepalive message |
| 37 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 38 | BgpKeepaliveMsg.Builder keepaliveMessageBuilder(); |
Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 39 | |
| 40 | /** |
| 41 | * Gets the builder object for a notification message. |
| 42 | * |
| 43 | * @return builder object for notification message. |
| 44 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 45 | BgpNotificationMsg.Builder notificationMessageBuilder(); |
Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 46 | |
| 47 | /** |
Shashikanth VH | 44967ec | 2016-02-04 19:46:16 +0530 | [diff] [blame] | 48 | * Gets the builder object for a update message. |
| 49 | * |
| 50 | * @return builder object for update message |
| 51 | */ |
| 52 | BgpUpdateMsg.Builder updateMessageBuilder(); |
| 53 | |
| 54 | /** |
Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 55 | * Gets the BGP message reader. |
| 56 | * |
| 57 | * @return BGP message reader |
| 58 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 59 | BgpMessageReader<BgpMessage> getReader(); |
Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 60 | |
| 61 | /** |
| 62 | * Returns BGP version. |
| 63 | * |
| 64 | * @return BGP version |
| 65 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 66 | BgpVersion getVersion(); |
Shashikanth VH | 95bd85e | 2015-10-27 14:56:33 +0530 | [diff] [blame] | 67 | } |