Removed checkstyle warnings.
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / DefaultPCEPSessionNegotiatorFactory.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.pcep.impl;
9
10 import com.google.common.base.Preconditions;
11
12 import io.netty.channel.Channel;
13 import io.netty.util.Timer;
14 import io.netty.util.concurrent.Promise;
15
16 import org.opendaylight.protocol.pcep.PCEPSessionListener;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open;
18
19 public final class DefaultPCEPSessionNegotiatorFactory extends AbstractPCEPSessionNegotiatorFactory {
20     private final Open localPrefs;
21     private final int maxUnknownMessages;
22     private final Timer timer;
23
24     public DefaultPCEPSessionNegotiatorFactory(final Timer timer, final Open localPrefs, final int maxUnknownMessages) {
25         this.timer = Preconditions.checkNotNull(timer);
26         this.localPrefs = Preconditions.checkNotNull(localPrefs);
27         this.maxUnknownMessages = maxUnknownMessages;
28     }
29
30     @Override
31     protected AbstractPCEPSessionNegotiator createNegotiator(final Promise<PCEPSessionImpl> promise, final PCEPSessionListener listener,
32             final Channel channel, final short sessionId) {
33         return new DefaultPCEPSessionNegotiator(this.timer, promise, channel, listener, sessionId, this.maxUnknownMessages, this.localPrefs);
34     }
35 }