import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public final class OpenConfigMappingUtil {
+final class OpenConfigMappingUtil {
- public static final String APPLICATION_PEER_GROUP_NAME = "application-peers";
- public static final Optional<String> APPLICATION_PEER_GROUP_NAME_OPT = Optional.of(APPLICATION_PEER_GROUP_NAME);
+ static final String APPLICATION_PEER_GROUP_NAME = "application-peers";
+ static final Optional<String> APPLICATION_PEER_GROUP_NAME_OPT = Optional.of(APPLICATION_PEER_GROUP_NAME);
static final int HOLDTIMER = 90;
private static final AfiSafi IPV4_AFISAFI = new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class).build();
private static final List<AfiSafi> DEFAULT_AFISAFI = ImmutableList.of(IPV4_AFISAFI);
throw new UnsupportedOperationException();
}
- public static String getRibInstanceName(final InstanceIdentifier<?> rootIdentifier) {
+ static String getRibInstanceName(final InstanceIdentifier<?> rootIdentifier) {
return rootIdentifier.firstKeyOf(Protocol.class).getName();
}
return null;
}
- public static KeyMapping getNeighborKey(final Neighbor neighbor) {
+ static KeyMapping getNeighborKey(final Neighbor neighbor) {
if (neighbor.getConfig() != null) {
final String authPassword = neighbor.getConfig().getAuthPassword();
if (authPassword != null) {
return null;
}
- public static InstanceIdentifier<Neighbor> getNeighborInstanceIdentifier(
+ static InstanceIdentifier<Neighbor> getNeighborInstanceIdentifier(
final InstanceIdentifier<Bgp> rootIdentifier,
final NeighborKey neighborKey) {
return rootIdentifier.child(Neighbors.class).child(Neighbor.class, neighborKey);
}
- public static String getNeighborInstanceName(final InstanceIdentifier<?> rootIdentifier) {
+ static String getNeighborInstanceName(final InstanceIdentifier<?> rootIdentifier) {
return Ipv4Util.toStringIP(rootIdentifier.firstKeyOf(Neighbor.class).getNeighborAddress());
}
}
//make sure IPv4 Unicast (RFC 4271) when required
- public static List<AfiSafi> getAfiSafiWithDefault(
+ static List<AfiSafi> getAfiSafiWithDefault(
final BgpCommonAfiSafiList afiSAfis, final boolean setDeafultIPv4) {
if (afiSAfis == null || afiSAfis.getAfiSafi() == null) {
return setDeafultIPv4 ? DEFAULT_AFISAFI : Collections.emptyList();
return afiSafi;
}
- public static ClusterIdentifier getGlobalClusterIdentifier(final org.opendaylight.yang.gen.v1.http.openconfig.net
+ static ClusterIdentifier getGlobalClusterIdentifier(final org.opendaylight.yang.gen.v1.http.openconfig.net
.yang.bgp.rev151009.bgp.global.base.Config globalConfig) {
final GlobalConfigAugmentation globalConfigAugmentation
= globalConfig.augmentation(GlobalConfigAugmentation.class);
}
@Nullable
- public static ClusterIdentifier getNeighborClusterIdentifier(
+ static ClusterIdentifier getNeighborClusterIdentifier(
@Nullable final RouteReflector routeReflector,
@Nullable final PeerGroup peerGroup) {
if (peerGroup != null) {
return null;
}
- public static Map<BgpTableType, PathSelectionMode> toPathSelectionMode(final List<AfiSafi> afiSafis,
+ static Map<BgpTableType, PathSelectionMode> toPathSelectionMode(final List<AfiSafi> afiSafis,
final BGPTableTypeRegistryConsumer tableTypeRegistry) {
final Map<BgpTableType, PathSelectionMode> pathSelectionModes = new HashMap<>();
for (final AfiSafi afiSafi : afiSafis) {
return pathSelectionModes;
}
- public static boolean isApplicationPeer(final Neighbor neighbor) {
+ static boolean isApplicationPeer(final Neighbor neighbor) {
final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group
.Config config = neighbor.getConfig();
if (config != null) {
return false;
}
- public static List<AddressFamilies> toAddPathCapability(final List<AfiSafi> afiSafis,
+ static List<AddressFamilies> toAddPathCapability(final List<AfiSafi> afiSafis,
final BGPTableTypeRegistryConsumer tableTypeRegistry) {
final List<AddressFamilies> addPathCapability = new ArrayList<>();
for (final AfiSafi afiSafi : afiSafis) {
return SendReceive.Receive;
}
- public static PeerRole toPeerRole(final BgpNeighborGroup neighbor) {
+ static PeerRole toPeerRole(final BgpNeighborGroup neighbor) {
if (isRrClient(neighbor)) {
return PeerRole.RrClient;
}
return false;
}
- public static List<BgpTableType> toTableTypes(final List<AfiSafi> afiSafis,
+ static List<BgpTableType> toTableTypes(final List<AfiSafi> afiSafis,
final BGPTableTypeRegistryConsumer tableTypeRegistry) {
return afiSafis.stream()
.map(afiSafi -> tableTypeRegistry.getTableType(afiSafi.getAfiSafiName()))
.collect(Collectors.toList());
}
- public static Set<TablesKey> toTableKey(final List<AfiSafi> afiSafis, final BGPTableTypeRegistryConsumer
+ static Set<TablesKey> toTableKey(final List<AfiSafi> afiSafis, final BGPTableTypeRegistryConsumer
tableTypeRegistry) {
return afiSafis.stream()
.map(afiSafi -> tableTypeRegistry.getTableKey(afiSafi.getAfiSafiName()))
.collect(Collectors.toSet());
}
- @Nonnull
- public static boolean isActive(final Neighbor neighbor, final PeerGroup peerGroup) {
+ static boolean isActive(final Neighbor neighbor, final PeerGroup peerGroup) {
Boolean activeConnection = null;
if (peerGroup != null) {
activeConnection = isActive(peerGroup.getTransport());
}
@Nonnull
- public static PeerRole toPeerRole(final Neighbor neighbor, final PeerGroup peerGroup) {
+ static PeerRole toPeerRole(final Neighbor neighbor, final PeerGroup peerGroup) {
PeerRole role = null;
if (peerGroup != null) {
role = toPeerRole(peerGroup);
return role;
}
- public static int getHoldTimer(final Neighbor neighbor, final PeerGroup peerGroup) {
+ static int getHoldTimer(final Neighbor neighbor, final PeerGroup peerGroup) {
Integer hold = null;
if (peerGroup != null) {
hold = getHoldTimer(peerGroup.getTimers());
}
@Nonnull
- public static AsNumber getRemotePeerAs(final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009
+ static AsNumber getRemotePeerAs(final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009
.bgp.neighbor.group.Config config, final PeerGroup peerGroup, final AsNumber localAs) {
AsNumber neighborAs = null;
if (peerGroup != null) {
}
@Nonnull
- public static AsNumber getLocalPeerAs(@Nullable final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp
+ static AsNumber getLocalPeerAs(@Nullable final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp
.rev151009.bgp.neighbor.group.Config config, @Nonnull final AsNumber globalAs) {
if (config != null) {
final AsNumber peerAs = config.getLocalAs();
return globalAs;
}
- public static int getRetryTimer(final Neighbor neighbor, final PeerGroup peerGroup) {
+ static int getRetryTimer(final Neighbor neighbor, final PeerGroup peerGroup) {
Integer retryTimer = null;
if (peerGroup != null) {
retryTimer = getRetryTimer(peerGroup.getTimers());
}
@Nonnull
- public static PortNumber getPort(final Neighbor neighbor, final PeerGroup peerGroup) {
+ static PortNumber getPort(final Neighbor neighbor, final PeerGroup peerGroup) {
PortNumber port = null;
if (peerGroup != null) {
port = getPort(peerGroup.getTransport(), PeerGroupTransportConfig.class);
}
@Nullable
- public static IpAddress getLocalAddress(@Nullable final Transport transport) {
+ static IpAddress getLocalAddress(@Nullable final Transport transport) {
if (transport != null && transport.getConfig() != null) {
final BgpNeighborTransportConfig.LocalAddress localAddress = transport.getConfig().getLocalAddress();
if (localAddress != null ) {