blob: bf2ccdfd5d92d3ee3dee53d60cee6bec47b3e80b [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;
Shashikanth VH44967ec2016-02-04 19:46:16 +053025import org.onosproject.bgpio.protocol.BgpUpdateMsg;
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053026import org.onosproject.bgpio.protocol.BgpVersion;
27
28/**
29 * Provides BGP Factory and returns builder classes for all objects and messages.
30 */
31public class BgpFactoryVer4 implements BgpFactory {
32
33 public static final BgpFactoryVer4 INSTANCE = new BgpFactoryVer4();
34
35 @Override
36 public BgpOpenMsg.Builder openMessageBuilder() {
37 return new BgpOpenMsgVer4.Builder();
38 }
39
40 @Override
41 public BgpKeepaliveMsg.Builder keepaliveMessageBuilder() {
42 return new BgpKeepaliveMsgVer4.Builder();
43 }
44
45 @Override
46 public BgpNotificationMsg.Builder notificationMessageBuilder() {
47 return new BgpNotificationMsgVer4.Builder();
48 }
49
50 @Override
Shashikanth VH44967ec2016-02-04 19:46:16 +053051 public BgpUpdateMsg.Builder updateMessageBuilder() {
52 return new BgpUpdateMsgVer4.Builder();
53 }
54
55 @Override
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053056 public BgpMessageReader<BgpMessage> getReader() {
57 return BgpMessageVer4.READER;
58 }
59
60 @Override
61 public BgpVersion getVersion() {
62 return BgpVersion.BGP_4;
63 }
64}