blob: 178f6e61213205db37c63d2b49d6ff05d38c6f17 [file] [log] [blame]
karthik1977bc5ea1e2023-01-02 19:25:14 +05301/*
2 * Copyright 2023-present Open Networking Foundation
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 */
16package org.onosproject.netflow.impl;
17
18import org.jboss.netty.channel.ChannelPipeline;
19import org.jboss.netty.channel.ChannelPipelineFactory;
20import org.jboss.netty.channel.Channels;
21
22
23/**
24 * Creates a ChannelPipeline for a server-side netflow message channel.
25 */
26public class NetflowPipelineFactory implements ChannelPipelineFactory {
27
28 /**
29 * Constructor to initialize the values.
30 */
31 public NetflowPipelineFactory() {
32 super();
33 }
34
35 /**
36 * Get server-side pipe line channel.
37 *
38 * @return ChannelPipeline server-side pipe line channel
39 * @throws Exception on while getting pipe line
40 */
41 @Override
42 public ChannelPipeline getPipeline() throws Exception {
43 NeflowChannelHandler handler = new NeflowChannelHandler();
44
45 ChannelPipeline pipeline = Channels.pipeline();
46 pipeline.addLast("netflowmessagedecoder", new NetflowMessageDecoder());
47 pipeline.addLast("ActiveHandler", handler);
48 return pipeline;
49 }
50
51}
52