2 * Copyright (c) 2014 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
9 package org.opendaylight.protocol.pcep.segment.routing;
11 import java.net.InetSocketAddress;
12 import org.opendaylight.protocol.pcep.ietf.initiated00.Stateful07SessionProposalFactory;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.Tlvs1;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.Tlvs1Builder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev150112.sr.pce.capability.tlv.SrPceCapabilityBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.TlvsBuilder;
18 public class SegmentRoutingSessionProposalFactory extends Stateful07SessionProposalFactory {
20 private final boolean isSegmentRoutingCapable;
22 public SegmentRoutingSessionProposalFactory(final int deadTimer, final int keepAlive, final boolean stateful, final boolean active,
23 final boolean instant, final boolean isSegmentRoutingCapable) {
24 super(deadTimer, keepAlive, stateful, active, instant);
25 this.isSegmentRoutingCapable = isSegmentRoutingCapable;
29 protected void addTlvs(final InetSocketAddress address, final TlvsBuilder builder) {
30 super.addTlvs(address, builder);
31 if (this.isSegmentRoutingCapable) {
32 builder.addAugmentation(Tlvs1.class,
33 new Tlvs1Builder().setSrPceCapability(new SrPceCapabilityBuilder().setMsd((short) 0).build())
38 public boolean isSegmentRoutingCapable() {
39 return this.isSegmentRoutingCapable;