blob: a1d9d5782d0f94f2d619102aabaa9db57d96eede [file] [log] [blame]
Priyanka B9aaa3112015-10-09 17:19:33 +05301/*
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 */
16package org.onosproject.bgpio.protocol;
17
18import org.onosproject.bgpio.exceptions.BGPParseException;
Priyanka B9aaa3112015-10-09 17:19:33 +053019
20/**
Priyanka B715854a2015-10-27 16:11:53 +053021 * Abstraction of an entity providing BGP notification message.
Priyanka B9aaa3112015-10-09 17:19:33 +053022 */
23public interface BGPNotificationMsg extends BGPMessage {
24 /**
Priyanka B715854a2015-10-27 16:11:53 +053025 * Returns errorCode in notification message.
Priyanka B9aaa3112015-10-09 17:19:33 +053026 *
Priyanka B715854a2015-10-27 16:11:53 +053027 * @return errorCode in notification message
Priyanka B9aaa3112015-10-09 17:19:33 +053028 */
29 byte getErrorCode();
30
31 /**
Priyanka B715854a2015-10-27 16:11:53 +053032 * Returns error subCode in notification message.
Priyanka B9aaa3112015-10-09 17:19:33 +053033 *
Priyanka B715854a2015-10-27 16:11:53 +053034 * @return error subCode in notification message
Priyanka B9aaa3112015-10-09 17:19:33 +053035 */
36 byte getErrorSubCode();
37
38 /**
Priyanka B715854a2015-10-27 16:11:53 +053039 * Returns error data in notification message.
Priyanka B9aaa3112015-10-09 17:19:33 +053040 *
Priyanka B715854a2015-10-27 16:11:53 +053041 * @return error data in notification message
Priyanka B9aaa3112015-10-09 17:19:33 +053042 */
43 byte[] getData();
44
45 /**
Priyanka B715854a2015-10-27 16:11:53 +053046 * Builder interface with get and set functions to build notification message.
Priyanka B9aaa3112015-10-09 17:19:33 +053047 */
48 public interface Builder extends BGPMessage.Builder {
49
50 @Override
51 BGPNotificationMsg build() throws BGPParseException;
52
53 /**
Priyanka B9aaa3112015-10-09 17:19:33 +053054 * Sets errorCode in notification message and return its builder.
55 *
56 * @param errorCode in notification message
Priyanka B715854a2015-10-27 16:11:53 +053057 * @return builder by setting errorCode in notification message
Priyanka B9aaa3112015-10-09 17:19:33 +053058 */
59 Builder setErrorCode(byte errorCode);
60
61 /**
Priyanka B715854a2015-10-27 16:11:53 +053062 * Sets error subCode in notification message and return its builder.
Priyanka B9aaa3112015-10-09 17:19:33 +053063 *
Priyanka B715854a2015-10-27 16:11:53 +053064 * @param errorSubCode in notification message
65 * @return builder by setting error subCode in notification message
Priyanka B9aaa3112015-10-09 17:19:33 +053066 */
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}