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.Channel;
11 import io.netty.util.Timer;
12 import io.netty.util.concurrent.Promise;
14 import org.opendaylight.protocol.pcep.PCEPSessionListener;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Open;
17 import com.google.common.base.Preconditions;
19 public final class DefaultPCEPSessionNegotiatorFactory extends AbstractPCEPSessionNegotiatorFactory {
20 private final Open localPrefs;
21 private final int maxUnknownMessages;
22 private final Timer timer;
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;
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);