- remove TLS/SSL support from netconf server and client
[controller.git] / opendaylight / netconf / netconf-util / src / main / java / org / opendaylight / controller / netconf / util / handler / NetconfHandlerFactory.java
diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfHandlerFactory.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfHandlerFactory.java
new file mode 100644 (file)
index 0000000..d878c5e
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.netconf.util.handler;
+
+import io.netty.channel.ChannelHandler;
+import org.opendaylight.controller.netconf.api.NetconfMessage;
+import org.opendaylight.controller.netconf.util.messages.NetconfMessageFactory;
+import org.opendaylight.protocol.framework.ProtocolHandlerFactory;
+import org.opendaylight.protocol.framework.ProtocolMessageDecoder;
+import org.opendaylight.protocol.framework.ProtocolMessageEncoder;
+
+public class NetconfHandlerFactory extends ProtocolHandlerFactory<NetconfMessage> {
+
+    public NetconfHandlerFactory(final NetconfMessageFactory msgFactory) {
+        super(msgFactory);
+    }
+
+    @Override
+    public ChannelHandler[] getEncoders() {
+        return new ChannelHandler[] { new ProtocolMessageEncoder(this.msgFactory) };
+    }
+
+    @Override
+    public ChannelHandler[] getDecoders() {
+        return new ChannelHandler[] { new ProtocolMessageDecoder(this.msgFactory) };
+    }
+
+}