blob: c57832b67b89a81c8fa678c9803971d6127660f2 [file] [log] [blame]
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +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 */
16
17package org.onosproject.bgpio.protocol.ver4;
18
19import org.onosproject.bgpio.protocol.BgpFactory;
20import org.onosproject.bgpio.protocol.BgpKeepaliveMsg;
21import org.onosproject.bgpio.protocol.BgpMessage;
22import org.onosproject.bgpio.protocol.BgpMessageReader;
23import org.onosproject.bgpio.protocol.BgpNotificationMsg;
24import org.onosproject.bgpio.protocol.BgpOpenMsg;
25import org.onosproject.bgpio.protocol.BgpVersion;
26
27/**
28 * Provides BGP Factory and returns builder classes for all objects and messages.
29 */
30public class BgpFactoryVer4 implements BgpFactory {
31
32 public static final BgpFactoryVer4 INSTANCE = new BgpFactoryVer4();
33
34 @Override
35 public BgpOpenMsg.Builder openMessageBuilder() {
36 return new BgpOpenMsgVer4.Builder();
37 }
38
39 @Override
40 public BgpKeepaliveMsg.Builder keepaliveMessageBuilder() {
41 return new BgpKeepaliveMsgVer4.Builder();
42 }
43
44 @Override
45 public BgpNotificationMsg.Builder notificationMessageBuilder() {
46 return new BgpNotificationMsgVer4.Builder();
47 }
48
49 @Override
50 public BgpMessageReader<BgpMessage> getReader() {
51 return BgpMessageVer4.READER;
52 }
53
54 @Override
55 public BgpVersion getVersion() {
56 return BgpVersion.BGP_4;
57 }
58}