*/
final BestPathState state = new BestPathStateImpl(attrs);
if (this.bestOriginatorId == null || !isExistingPathBetter(state)) {
- LOG.trace("Selecting path from router {}", RouterIds.createPeerId(routerId).getValue());
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Selecting path from router {}", RouterIds.createPeerIdString(routerId));
+ }
this.bestOriginatorId = originatorId;
this.bestState = state;
this.bestRouteKey = key;
*/
final BestPathState state = new BestPathStateImpl(attrs);
if (this.bestOriginatorId == null || !isExistingPathBetter(state)) {
- LOG.trace("Selecting path from router {}", RouterIds.createPeerId(routerId).getValue());
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Selecting path from router {}", RouterIds.createPeerIdString(routerId));
+ }
this.bestOriginatorId = originatorId;
this.bestRouterId = routerId;
this.bestState = state;
}
}
-
BaseBestPath result() {
return this.bestRouterId == null ? null : new BaseBestPath(this.bestRouterId, this.bestState);
}
}
public static PeerId createPeerId(@Nonnull final UnsignedInteger intAddress) {
+ return new PeerId(createPeerIdString(intAddress));
+ }
+
+ public static String createPeerIdString(@Nonnull final UnsignedInteger intAddress) {
final String inet4Address = InetAddresses.fromInteger(intAddress.intValue()).getHostAddress();
- return new PeerId(BGP_PREFIX.concat(inet4Address));
+ return BGP_PREFIX.concat(inet4Address);
}
public static Ipv4Address inetFromPeerId(@Nonnull final PeerId peerId) {