@Override
public void resetStats() {
if (this.session instanceof BGPSessionStatistics) {
- ((BGPSessionStatistics) session).resetSessionStats();
+ ((BGPSessionStatistics) this.session).resetSessionStats();
}
}
- public void registerRootRuntimeBean(final BGPPeerRuntimeRegistrator registrator) {
+ public synchronized void registerRootRuntimeBean(final BGPPeerRuntimeRegistrator registrator) {
this.registrator = registrator;
}
@Override
public BgpSessionState getBgpSessionState() {
if (this.session instanceof BGPSessionStatistics) {
- return ((BGPSessionStatistics) session).getBgpSesionState();
+ return ((BGPSessionStatistics) this.session).getBgpSesionState();
}
return new BgpSessionState();
}
@Override
- public BgpPeerState getBgpPeerState() {
+ public synchronized BgpPeerState getBgpPeerState() {
final BgpPeerState peerState = new BgpPeerState();
final List<RouteTable> routes = Lists.newArrayList();
for (final TablesKey tablesKey : this.tables) {
}
@Override
- public BgpSessionState getBgpSesionState() {
+ public synchronized BgpSessionState getBgpSesionState() {
return this.sessionStats.getBgpSessionState(this.state);
}
* @param id instance identifier
* @return router identifier
*/
- public abstract @Nullable KeyedInstanceIdentifier<D, K> routeIdentifier(InstanceIdentifier<?> id);
+ @Nullable
+ public abstract KeyedInstanceIdentifier<D, K> routeIdentifier(InstanceIdentifier<?> id);
/**
* Craates route key out of instance identifier
ab.setRouterType(new PseudonodeBuilder().setPseudonode(Boolean.TRUE).build());
ab.setDrInterfaceId(pn.getLanInterface().getValue());
- } else if (ri instanceof OspfNodeCase) {
+ } else if (ri instanceof OspfNodeCase && na != null && na.getNodeFlags() != null) {
// TODO: what should we do with in.getOspfRouterId()?
- // final OspfNode in = ((OspfNodeCase) ri).getOspfNode();
-
- if (na != null && na.getNodeFlags() != null) {
- final NodeFlagBits nf = na.getNodeFlags();
- if (nf.isAbr()) {
- ab.setRouterType(new AbrBuilder().setAbr(Boolean.TRUE).build());
- } else if (!nf.isExternal()) {
- ab.setRouterType(new InternalBuilder().setInternal(Boolean.TRUE).build());
- }
+
+ final NodeFlagBits nf = na.getNodeFlags();
+ if (nf.isAbr()) {
+ ab.setRouterType(new AbrBuilder().setAbr(Boolean.TRUE).build());
+ } else if (!nf.isExternal()) {
+ ab.setRouterType(new InternalBuilder().setInternal(Boolean.TRUE).build());
}
}
public class DataChangeCounterImplModule extends org.opendaylight.controller.config.yang.bgpcep.data.change.counter.AbstractDataChangeCounterImplModule {
- public DataChangeCounterImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
- org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ public DataChangeCounterImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public DataChangeCounterImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
- org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
- org.opendaylight.controller.config.yang.bgpcep.data.change.counter.DataChangeCounterImplModule oldModule,
- java.lang.AutoCloseable oldInstance) {
+ public DataChangeCounterImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ final org.opendaylight.controller.config.yang.bgpcep.data.change.counter.DataChangeCounterImplModule oldModule,
+ final java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
private final TopologyDataChangeCounter inner;
private final ListenerRegistration<DataChangeListener> registration;
- public DataChangeCounterCloseable(TopologyDataChangeCounter inner,
- ListenerRegistration<DataChangeListener> registration) {
+ public DataChangeCounterCloseable(final TopologyDataChangeCounter inner,
+ final ListenerRegistration<DataChangeListener> registration) {
this.inner = inner;
this.registration = registration;
}
@Override
- public void close() throws Exception {
+ public void close() {
this.registration.close();
this.inner.close();
}
import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedInt;
import com.google.common.base.Preconditions;
-
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
-
import org.opendaylight.protocol.pcep.spi.EnterpriseSpecificInformationParser;
import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
import org.opendaylight.protocol.pcep.spi.TlvParser;
private static final int KA_TO_DEADTIMER_RATIO = 4;
- public static void main(final String[] args) throws NumberFormatException, UnknownHostException, InterruptedException, ExecutionException {
+ public static void main(final String[] args) throws UnknownHostException, InterruptedException, ExecutionException {
if (args.length == 0 || (args.length == 1 && args[0].equalsIgnoreCase("--help"))) {
LOG.info(Main.USAGE);
return;
}
@Override
- public String getPeerId() {
+ public synchronized String getPeerId() {
return this.session.getPeerPref().getIpAddress();
}
}