use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.ted.rev131021.srlg.attributes.SrlgValues in project bgpcep by opendaylight.
the class ProtocolUtil method isisLinkAttributes.
private static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.IgpLinkAttributes1 isisLinkAttributes(final TopologyIdentifier topologyIdentifier, final LinkAttributes la) {
final org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.isis.link.attributes.isis.link.attributes.TedBuilder tb = new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.isis.link.attributes.isis.link.attributes.TedBuilder();
if (la != null) {
if (la.getAdminGroup() != null) {
tb.setColor(la.getAdminGroup().getValue());
}
if (la.getTeMetric() != null) {
tb.setTeDefaultMetric(la.getTeMetric().getValue());
}
if (la.getUnreservedBandwidth() != null) {
tb.setUnreservedBandwidth(unreservedBandwidthList(la.getUnreservedBandwidth()));
}
if (la.getMaxLinkBandwidth() != null) {
tb.setMaxLinkBandwidth(bandwidthToBigDecimal(la.getMaxLinkBandwidth()));
}
if (la.getMaxReservableBandwidth() != null) {
tb.setMaxResvLinkBandwidth(bandwidthToBigDecimal(la.getMaxReservableBandwidth()));
}
if (la.getSharedRiskLinkGroups() != null) {
final List<SrlgValues> srlgs = new ArrayList<>();
for (final SrlgId id : la.getSharedRiskLinkGroups()) {
srlgs.add(new SrlgValuesBuilder().setSrlgValue(id.getValue()).build());
}
tb.setSrlg(new SrlgBuilder().setSrlgValues(srlgs).build());
}
}
final IsisLinkAttributesBuilder ilab = new IsisLinkAttributesBuilder();
ilab.setTed(tb.build());
if (topologyIdentifier != null) {
ilab.setMultiTopologyId(topologyIdentifier.getValue().shortValue());
}
return new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.IgpLinkAttributes1Builder().setIsisLinkAttributes(ilab.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.ted.rev131021.srlg.attributes.SrlgValues in project bgpcep by opendaylight.
the class ProtocolUtil method ospfLinkAttributes.
private static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.IgpLinkAttributes1 ospfLinkAttributes(final TopologyIdentifier topologyIdentifier, final LinkAttributes la) {
final org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.ospf.link.attributes.ospf.link.attributes.TedBuilder tb = new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.ospf.link.attributes.ospf.link.attributes.TedBuilder();
if (la != null) {
if (la.getAdminGroup() != null) {
tb.setColor(la.getAdminGroup().getValue());
}
if (la.getTeMetric() != null) {
tb.setTeDefaultMetric(la.getTeMetric().getValue());
}
if (la.getUnreservedBandwidth() != null) {
tb.setUnreservedBandwidth(unreservedBandwidthList(la.getUnreservedBandwidth()));
}
if (la.getMaxLinkBandwidth() != null) {
tb.setMaxLinkBandwidth(bandwidthToBigDecimal(la.getMaxLinkBandwidth()));
}
if (la.getMaxReservableBandwidth() != null) {
tb.setMaxResvLinkBandwidth(bandwidthToBigDecimal(la.getMaxReservableBandwidth()));
}
if (la.getSharedRiskLinkGroups() != null) {
final List<SrlgValues> srlgs = new ArrayList<>();
for (final SrlgId id : la.getSharedRiskLinkGroups()) {
srlgs.add(new SrlgValuesBuilder().setSrlgValue(id.getValue()).build());
}
tb.setSrlg(new SrlgBuilder().setSrlgValues(srlgs).build());
}
}
final OspfLinkAttributesBuilder ilab = new OspfLinkAttributesBuilder();
ilab.setTed(tb.build());
if (topologyIdentifier != null) {
ilab.setMultiTopologyId(topologyIdentifier.getValue().shortValue());
}
return new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.IgpLinkAttributes1Builder().setOspfLinkAttributes(ilab.build()).build();
}
Aggregations