</session-config>
</node>
</topology>
+ <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
+ <topology-id>pcep-tunnel-topology</topology-id>
+ <topology-types>
+ <topology-tunnel-pcep xmlns="urn:opendaylight:params:xml:ns:yang:topology:tunnel:pcep"></topology-tunnel-pcep>
+ </topology-types>
+ <pcep-topology-reference xmlns="urn:opendaylight:params:xml:ns:yang:topology:tunnel:pcep:config">
+ /topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]
+ </pcep-topology-reference>
+ </topology>
</network-topology>
\ No newline at end of file
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.GuardedBy;
+import org.apache.commons.lang3.StringUtils;
import org.opendaylight.bgpcep.pcep.topology.provider.config.PCEPTopologyDeployerImpl;
import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
final BundleContext bundleContext,
final ClusterSingletonServiceProvider cssp
) {
+ LOG.info("Creating Tunnel Provider Deployer");
this.dependencies = new TunnelProviderDependencies(dataBroker, cssp, rpcProviderRegistry, bundleContext);
this.networTopology = InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class).build();
}
}
public synchronized void init() {
+ LOG.info("Instantiate tunnel topology deployer");
this.listenerRegistration = this.dependencies.getDataBroker().registerDataTreeChangeListener(
new DataTreeIdentifier<>(CONFIGURATION, this.networTopology), this);
}
LOG.warn("Tunnel Topology {} already exist. New instance won't be created", topologyId);
return;
}
+ LOG.debug("Create Tunnel Topology {}", topologyId);
final PcepTunnelTopologyConfig config = topology.getAugmentation(PcepTunnelTopologyConfig.class);
- final String pcepTopoID = config.getPcepTopologyReference().getValue();
-
+ final String pcepTopoID = StringUtils
+ .substringBetween(config.getPcepTopologyReference().getValue(), "=\"", "\"");
final InstanceIdentifier<Topology> pcepTopoRef = InstanceIdentifier.builder(NetworkTopology.class)
.child(Topology.class, new TopologyKey(new TopologyId(pcepTopoID))).build();
@Override
public synchronized void close() {
+ LOG.info("Closing tunnel topology deployer");
if (this.listenerRegistration != null) {
this.listenerRegistration.close();
this.listenerRegistration = null;