52e3b73cecc8c79d786b2feaa8e5183483991578
[bgpcep.git] / framework / src / test / java / org / opendaylight / protocol / framework / SimpleSessionFactory.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.framework;
9
10 import io.netty.channel.Channel;
11
12 import java.util.Timer;
13
14 public final class SimpleSessionFactory implements ProtocolSessionFactory<SimpleSession> {
15         private final int maximumMessageSize;
16
17         public SimpleSessionFactory(final int maximumMessageSize) {
18                 this.maximumMessageSize = maximumMessageSize;
19         }
20
21         @Override
22         public SimpleSession getProtocolSession(final SessionParent parent, final Timer timer, final ProtocolConnection connection,
23                         final int sessionId, final Channel channel) {
24                 return new SimpleSession(connection, parent, this.maximumMessageSize);
25         }
26 }