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.pcep.impl;
10 import io.netty.channel.ChannelHandler;
12 import org.opendaylight.protocol.framework.ProtocolHandlerFactory;
13 import org.opendaylight.protocol.framework.ProtocolMessageDecoder;
14 import org.opendaylight.protocol.framework.ProtocolMessageEncoder;
15 import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
19 * PCEP specific factory for protocol inbound/outbound handlers.
21 public class PCEPHandlerFactory extends ProtocolHandlerFactory<Message> {
22 private final ProtocolMessageEncoder<Message> encoder;
24 public PCEPHandlerFactory(final MessageHandlerRegistry registry) {
25 super(new PCEPMessageFactory(registry));
26 this.encoder = new ProtocolMessageEncoder<Message>(this.msgFactory);
30 public ChannelHandler[] getEncoders() {
31 return new ChannelHandler[] { this.encoder };
35 public ChannelHandler[] getDecoders() {
36 return new ChannelHandler[] { new PCEPMessageHeaderDecoder(), new ProtocolMessageDecoder<Message>(this.msgFactory) };