blob: 4508f0eb564d5a90c5480c3d120e1191cc513130 [file] [log] [blame]
Niraj Dubeyb7921b22021-09-07 15:21:42 +05301/*
2 * Copyright 2021-present Open Networking Foundation
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 */
16package org.onosproject.bgpmonitoring;
17
18import org.onlab.packet.bmp.Bmp;
19import org.onlab.packet.bmp.BmpPeer;
20
21/**
22 * Abstraction of an entity providing BMP Messages.
23 */
24public interface BmpMessage {
25
26 /**
27 * Returns BMP Header of BMP Message.
28 *
29 * @return BMP Header of BMP Message
30 */
31 Bmp getHeader();
32
33 /**
34 * Returns BMP Peer Header of BMP Message.
35 *
36 * @return BMP Peer Header of BMP Message
37 */
38 default BmpPeer getPeerHeader() {
39 throw new UnsupportedOperationException("Bmp Per Peer Header not supported");
40 }
41
42 /**
43 * Is bmp message has peer header.
44 *
45 * @return true if bmp has peer header otherwise false
46 */
47 default boolean hasPeerHeader() {
48 return true;
49 }
50
51 /**
52 * Returns version of BMP Message.
53 *
54 * @return version of BMP Message
55 */
56 default BmpVersion getVersion() {
57 return BmpVersion.BMP_3;
58 }
59
60 /**
61 * Returns BMP Type of BMP Message.
62 *
63 * @return BMP Type of BMP Message
64 */
65 BmpType getType();
66}