import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.config.rev230112.PcepSessionTls;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev220730.Node1;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev220730.TopologyTypes1;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
new PCEPStatefulCapability(), P2MPTeLspCapability.of(), PCEPSegmentRoutingCapability.of());
private final @NonNull InetSocketAddress address;
- private final @NonNull GraphKey graphKey;
+ private final @Nullable GraphKey graphKey;
private final @NonNull KeyMapping keys;
private final @NonNull PCEPTimerProposal timerProposal;
private final @NonNull ImmutableList<PCEPCapability> capabilities;
private final long updateIntervalNanos;
private final short rpcTimeout;
- PCEPTopologyConfiguration(final InetSocketAddress address, final KeyMapping keys, final GraphKey graphKey,
+ PCEPTopologyConfiguration(final InetSocketAddress address, final KeyMapping keys, final @Nullable GraphKey graphKey,
final short rpcTimeout, final long updateIntervalNanos, final PCEPTimerProposal timerProposal,
final @NonNull ImmutableList<PCEPCapability> capabilities, final Uint16 maxUnknownMessages,
final @Nullable PcepSessionTls tls) {
this.address = requireNonNull(address);
this.keys = requireNonNull(keys);
- this.graphKey = requireNonNull(graphKey);
+ this.graphKey = graphKey;
this.rpcTimeout = rpcTimeout;
this.updateIntervalNanos = updateIntervalNanos;
this.timerProposal = requireNonNull(timerProposal);
}
final var capabilityAug = topologyPcep.augmentation(TopologyPcep1.class);
final var capabilities = capabilityAug != null ? capabilityAug.getCapabilities() : null;
+
if (capabilities != null && !capabilities.nonnullStateful().requireEnabled()) {
return null;
}
return keys;
}
- @NonNull GraphKey getGraphKey() {
+ @Nullable GraphKey getGraphKey() {
return graphKey;
}
return KeyMapping.of(passwords);
}
- private static @NonNull GraphKey constructGraphKey(final String name) {
- return new GraphKey(name.startsWith("ted://") ? name : "ted://" + name);
+ private static @Nullable GraphKey constructGraphKey(final @Nullable TopologyId topologyId) {
+ return topologyId != null ? new GraphKey("ted://" + topologyId.getValue()) : null;
}
private static InetAddress nodeAddress(final Node node) {
private final @NonNull KeyedInstanceIdentifier<Topology, TopologyKey> topology;
private final @NonNull PCEPTopologyProviderDependencies dependencies;
- private final @NonNull GraphKey graphKey;
+ private final @Nullable GraphKey graphKey;
@GuardedBy("this")
private final Map<NodeId, TopologySessionListener> nodes = new HashMap<>();
final short rpcTimeout, final long updateInterval) {
this.dependencies = requireNonNull(dependencies);
this.topology = requireNonNull(topology);
- this.graphKey = requireNonNull(graphKey);
+ this.graphKey = graphKey;
this.rpcTimeout = rpcTimeout;
this.updateInterval = updateInterval;
}
// Register this new topology to PCE Server
final PceServerProvider server = dependencies.getPceServerProvider();
- if (server != null) {
+ if (server != null && graphKey != null) {
server.registerPcepTopology(topology, graphKey);
}
return future;