protected abstract ByteBuf serializeBody(T mvpn);
- final MulticastSourceRdGrouping parseRDMulticastSource(final ByteBuf buffer) {
+ static final MulticastSourceRdGrouping parseRDMulticastSource(final ByteBuf buffer) {
final SPmsiADBuilder builder = new SPmsiADBuilder();
builder.setRouteDistinguisher(RouteDistinguisherUtil.parseRouteDistinguisher(buffer));
final IpAddress address = IpAddressUtil.addressForByteBuf(buffer);
return builder.build();
}
- final void serializeRDMulticastSource(final MulticastSourceRdGrouping route, final ByteBuf output) {
+ static final void serializeRDMulticastSource(final MulticastSourceRdGrouping route, final ByteBuf output) {
RouteDistinguisherUtil.serializeRouteDistinquisher(route.getRouteDistinguisher(), output);
output.writeBytes(IpAddressUtil.bytesFor(route.getMulticastSource()));
}
assertEquals(expected, actualAttr);
}
- private Attributes buildPEDistinguisherLabelsAttributAttribute() {
- final List<PeDistinguisherLabelAttribute> peAtt = new ArrayList<>();
+ private static Attributes buildPEDistinguisherLabelsAttributAttribute() {
+ final List<PeDistinguisherLabelAttribute> peAtt = new ArrayList<>(2);
peAtt.add(new PeDistinguisherLabelAttributeBuilder()
.setPeAddress(new IpAddress(new Ipv4Address("127.0.0.1")))
/**
* Create new table instances, potentially creating their empty entries
*/
- private ImmutableMap<TablesKey, TableContext> createNewTableInstances(final YangInstanceIdentifier newPeerPath,
- final RIBSupportContextRegistry registry, final Set<TablesKey> tableTypes,
- final Map<TablesKey, SendReceive> addPathTablesType, final DOMDataWriteTransaction tx) {
+ private static ImmutableMap<TablesKey, TableContext> createNewTableInstances(
+ final YangInstanceIdentifier newPeerPath, final RIBSupportContextRegistry registry,
+ final Set<TablesKey> tableTypes, final Map<TablesKey, SendReceive> addPathTablesType,
+ final DOMDataWriteTransaction tx) {
final Builder<TablesKey, TableContext> tb = ImmutableMap.builder();
for (final TablesKey tableKey : tableTypes) {
tb.put(tableKey, ctx);
}
- private void installAdjRibsOutTables(final YangInstanceIdentifier newPeerPath, final RIBSupportContext rs,
+ private static void installAdjRibsOutTables(final YangInstanceIdentifier newPeerPath, final RIBSupportContext rs,
final NodeIdentifierWithPredicates instanceIdentifierKey, final TablesKey tableKey,
final SendReceive sendReceive, final DOMDataWriteTransaction tx) {
final NodeIdentifierWithPredicates supTablesKey = RibSupportUtils.toYangKey(SupportedTables.QNAME, tableKey);
this.reg = requireNonNull(this.databroker).registerDataTreeChangeListener(treeId, this);
}
- private Map<TablesKey, LongAdder> buildPrefixesTables(final Set<TablesKey> tables) {
+ private static Map<TablesKey, LongAdder> buildPrefixesTables(final Set<TablesKey> tables) {
final ImmutableMap.Builder<TablesKey, LongAdder> b = ImmutableMap.builder();
tables.forEach(table -> b.put(table, new LongAdder()));
return b.build();
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IetfInetUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.Open;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.open.message.BgpParameters;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.open.message.bgp.parameters.OptionalCapabilities;
}
}
- private IpAddress getFullIp(final IpAddress ip) {
- requireNonNull(ip);
- if (ip.getIpv6Address() != null) {
- return new IpAddress(Ipv6Util.getFullForm(ip.getIpv6Address()));
- }
- return ip;
+ private static IpAddress getFullIp(final IpAddress ip) {
+ final Ipv6Address addr = ip.getIpv6Address();
+ return addr == null ? ip : new IpAddress(Ipv6Util.getFullForm(addr));
}
@Override
LOG.debug("Peer instance created {}", bgpPeer);
}
- private String getPeerGroupName(final Config config) {
- if (config != null && config.getAugmentation(NeighborPeerGroupConfig.class) != null) {
- return config.getAugmentation(NeighborPeerGroupConfig.class).getPeerGroup();
+ private static String getPeerGroupName(final Config config) {
+ if (config == null) {
+ return null;
}
- return null;
+ final NeighborPeerGroupConfig aug = config.getAugmentation(NeighborPeerGroupConfig.class);
+ return aug == null ? null : aug.getPeerGroup();
}
private synchronized void onNeighborUpdated(final PeerBean bgpPeer, final Neighbor neighbor) {
LOG.debug("Peer instance updated {}", bgpPeer);
}
- private void closePeer(final PeerBean bgpPeer) {
+ private static void closePeer(final PeerBean bgpPeer) {
if (bgpPeer != null) {
try {
bgpPeer.closeServiceInstance().get();