2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.rib.impl;
10 import io.netty.channel.ChannelHandler;
12 import org.opendaylight.protocol.bgp.parser.BGPMessageFactory;
13 import org.opendaylight.protocol.framework.ProtocolHandlerFactory;
14 import org.opendaylight.protocol.framework.ProtocolMessageDecoder;
15 import org.opendaylight.protocol.framework.ProtocolMessageEncoder;
16 import org.opendaylight.yangtools.yang.binding.Notification;
19 * BGP specific factory for protocol inbound/outbound handlers.
21 public class BGPHandlerFactory extends ProtocolHandlerFactory<Notification> {
22 private final ProtocolMessageEncoder<Notification> encoder;
24 public BGPHandlerFactory(final BGPMessageFactory msgFactory) {
26 this.encoder = new ProtocolMessageEncoder<Notification>(this.msgFactory);
30 public ChannelHandler[] getEncoders() {
31 return new ChannelHandler[] { this.encoder };
35 public ChannelHandler[] getDecoders() {
36 return new ChannelHandler[] { new BGPMessageHeaderDecoder(), new ProtocolMessageDecoder<Notification>(this.msgFactory) };