import java.net.InetSocketAddress;
import org.kohsuke.MetaInfServices;
import org.opendaylight.protocol.pcep.PCEPCapability;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.p2mp.te.lsp.rev181109.TlvsP2mpCapabilityAug;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.p2mp.te.lsp.rev181109.TlvsP2mpCapabilityAugBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.p2mp.te.lsp.rev181109.p2mp.pce.capability.tlv.P2mpPceCapabilityBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.TlvsBuilder;
@MetaInfServices
public final class P2MPTeLspCapability implements PCEPCapability {
- private static final TlvsP2mpCapabilityAug PATH_COMPUTATION_CAP_AUG = new TlvsP2mpCapabilityAugBuilder()
- .setP2mpPceCapability(new P2mpPceCapabilityBuilder().build())
- .build();
-
- private final boolean supportsPathComputation;
-
- public P2MPTeLspCapability() {
- this(true);
- }
-
- // FIXME: this should return distinct implementations
- public P2MPTeLspCapability(final boolean supportsP2MPTeLspPathComputation) {
- this.supportsPathComputation = supportsP2MPTeLspPathComputation;
- }
-
@Override
public void setCapabilityProposal(final InetSocketAddress address, final TlvsBuilder builder) {
- if (supportsPathComputation) {
- builder.addAugmentation(PATH_COMPUTATION_CAP_AUG);
- }
+ builder.addAugmentation(new TlvsP2mpCapabilityAugBuilder()
+ .setP2mpPceCapability(new P2mpPceCapabilityBuilder().build())
+ .build());
}
@Override
@Override
public String toString() {
- return MoreObjects.toStringHelper(this).add("pathComputation", supportsPathComputation).toString();
+ return MoreObjects.toStringHelper(this).toString();
}
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright (c) 2018 AT&T Intellectual Property.
- ~ All rights reserved.
- ~ This program and the accompanying materials are made available under the
- ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
- ~ and is available at http://www.eclipse.org/legal/epl-v10.html
- -->
-<blueprint xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
- <odl:clustered-app-config id="p2mpTeLspConfig"
- binding-class="org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.p2mp.te.lsp.config.rev181109.PcepP2mpTeLspConfig"/>
-
- <!-- Capabilities -->
- <bean id="p2mpTeLspCapability" class="org.opendaylight.protocol.pcep.p2mp.te.lsp.P2MPTeLspCapability">
- <argument>
- <bean factory-ref="p2mpTeLspConfig" factory-method="getPathComputationCapable"/>
- </argument>
- </bean>
-
- <service ref="p2mpTeLspCapability" interface="org.opendaylight.protocol.pcep.PCEPCapability"
- odl:type="org.opendaylight.protocol.pcep.p2mp.te.lsp.P2MPTeLspCapability"/>
-</blueprint>
module odl-pcep-p2mp-te-lsp {
yang-version 1;
+ // FIXME: rename module/namespace to odl-pcep-rfc8306
namespace "urn:opendaylight:params:xml:ns:yang:pcep:p2mp:te:lsp";
prefix "pcep-p2mp";
description
"This module contains the data model of PCEP extensions defined
- in rfc8306.
+ in RFC8306.
+
Copyright (c)2018 AT&T Services, Inc. All rights reserved.;
This program and the accompanying materials are made available
uses p2mp-pce-capability-tlv;
ext:augment-identifier tlvs-p2mp-capability-error-aug;
}
-}
\ No newline at end of file
+}
+++ /dev/null
-module pcep-p2mp-te-lsp-config {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:controller:pcep:p2mp:te:lsp:config";
- prefix "pcep-p2mp-config";
-
- description
- "Configuration for the PCEP p2mp te lsp extension.
- Copyright (c)2018 AT&T Services, Inc. All rights reserved.;
-
- This program and the accompanying materials are made available
- under the terms of the Eclipse Public License v1.0 which
- accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html";
-
- organization "AT&T Services, Inc.";
- contact "Claudio D. Gasparini <claudio.gasparini@pantheon.sk>";
-
- revision "2018-11-09" {
- description "Initial revision";
- }
-
- container pcep-p2mp-te-lsp-config {
- leaf path-computation-capable {
- description "Advertize pcep-p2mp-te-lsp path computation capability";
- type boolean;
- default false;
- }
- }
-}
\ No newline at end of file