* RIB actions.
*/
public final class BGPPeer implements BGPSessionListener, Peer {
- private static final Logger logger = LoggerFactory.getLogger(BGPPeer.class);
+ private static final Logger LOG = LoggerFactory.getLogger(BGPPeer.class);
private final Set<TablesKey> tables = Sets.newHashSet();
private final String name;
private final RIBImpl rib;
if (message instanceof Update) {
this.rib.updateTables(this, (Update) message);
} else {
- logger.info("Ignoring unhandled message class " + message.getClass());
+ LOG.info("Ignoring unhandled message class " + message.getClass());
}
}
@Override
public void onSessionUp(final BGPSession session) {
- logger.info("Session with peer {} went up with tables: {}", this.name, session.getAdvertisedTableTypes());
+ LOG.info("Session with peer {} went up with tables: {}", this.name, session.getAdvertisedTableTypes());
for (final BgpTableType t : session.getAdvertisedTableTypes()) {
this.tables.add(new TablesKey(t.getAfi(), t.getSafi()));
}
private void cleanup() {
- // FIXME: support graceful restart
+ // FIXME: BUG-196: support graceful restart
for (final TablesKey key : this.tables) {
this.rib.clearTable(this, key);
}
@Override
public void onSessionDown(final BGPSession session, final Exception e) {
- logger.info("Session with peer {} went down", this.name, e);
+ LOG.info("Session with peer {} went down", this.name, e);
cleanup();
}
@Override
public void onSessionTerminated(final BGPSession session, final BGPTerminationReason cause) {
- logger.info("Session with peer {} terminated: {}", this.name, cause);
+ LOG.info("Session with peer {} terminated: {}", this.name, cause);
cleanup();
}
@Override
- public final String toString() {
+ public String toString() {
return addToStringAttributes(Objects.toStringHelper(this)).toString();
}