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.PCEPCapability;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.Tlvs1;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.Tlvs1Builder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev181109.sr.pce.capability.tlv.SrPceCapabilityBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
18 public class PCEPSegmentRoutingCapability implements PCEPCapability {
20 private final boolean isSegmentRoutingCapable;
22 public PCEPSegmentRoutingCapability(final boolean isSegmentRoutingCapable) {
23 this.isSegmentRoutingCapable = isSegmentRoutingCapable;
27 public void setCapabilityProposal(final InetSocketAddress address, final TlvsBuilder builder) {
28 if (this.isSegmentRoutingCapable) {
29 builder.addAugmentation(Tlvs1.class,
30 new Tlvs1Builder().setSrPceCapability(new SrPceCapabilityBuilder().setMsd((short) 0).build())
35 public boolean isSegmentRoutingCapable() {
36 return this.isSegmentRoutingCapable;
40 public boolean isStateful() {