blob: e3361aa72b9c2f065175668205dfb07eac280aa1 [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
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053018import 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 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053023public interface BgpNotificationMsg extends BgpMessage {
Priyanka B9aaa3112015-10-09 17:19:33 +053024 /**
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 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053048 public interface Builder extends BgpMessage.Builder {
Priyanka B9aaa3112015-10-09 17:19:33 +053049
50 @Override
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053051 BgpNotificationMsg build() throws BgpParseException;
Priyanka B9aaa3112015-10-09 17:19:33 +053052
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}