import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.base.Objects.ToStringHelper;
import com.google.common.base.Preconditions;
final class LinkstateAdjRIBsIn extends AbstractAdjRIBsIn<CLinkstateDestination, LinkstateRoute> {
private abstract static class LinkstateRIBEntryData<A extends LinkStateAttribute> extends
- RIBEntryData<CLinkstateDestination, LinkstateRoute> {
+ RIBEntryData<CLinkstateDestination, LinkstateRoute> {
private final A lsattr;
protected LinkstateRIBEntryData(final PathAttributes attributes, final A lsattr) {
return builder.build();
}
+
+ @Override
+ protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
+ return toStringHelper.add("lsattr", lsattr);
+ }
}
private static final Logger LOG = LoggerFactory.getLogger(LinkstateAdjRIBsIn.class);
LOG.debug("Iterating over route destinations {}", keys);
for (final CLinkstateDestination key : keys.getCLinkstateDestination()) {
+ LOG.debug("Processing route key {}", key);
+
LinkStateAttribute lsattr = null;
final PathAttributes1 pa = attributes.getAugmentation(PathAttributes1.class);
if (pa != null) {
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
import com.google.common.base.Preconditions;
@ThreadSafe
}
protected abstract D getDataObject(I key);
+
+ @Override
+ public final String toString() {
+ return addToStringAttributes(Objects.toStringHelper(this)).toString();
+ }
+
+ protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
+ return toStringHelper.add("attributes", attributes);
+ }
}
/**
protected abstract InstanceIdentifier<?> identifierForKey(final InstanceIdentifier<Tables> basePath, final I id);
protected synchronized void add(final DataModificationTransaction trans, final Peer peer, final I id, final RIBEntryData<I, D> data) {
+ LOG.debug("Adding state {} for {} peer {}", data, id, peer);
+
RIBEntry e = this.entries.get(Preconditions.checkNotNull(id));
if (e == null) {
e = new RIBEntry(id);
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.DomainName;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev131125.Ipv4InterfaceIdentifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev131125.Ipv6InterfaceIdentifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev131125.NodeFlagBits;
lb.setSource(new SourceBuilder().setSourceNode(srcNode).setSourceTp(srcTp.getTpId()).build());
lb.setDestination(new DestinationBuilder().setDestNode(dstNode).setDestTp(dstTp.getTpId()).build());
- trans.putOperationalData(buildTpIdentifier(srcNode, srcTp.getKey()), srcTp);
- trans.putOperationalData(buildTpIdentifier(dstNode, dstTp.getKey()), dstTp);
+ final InstanceIdentifier<TerminationPoint> stpId = buildTpIdentifier(srcNode, srcTp.getKey());
+ trans.putOperationalData(stpId, srcTp);
+ LOG.debug("Created TP {} at {} as link source", srcTp, stpId);
+
+ final InstanceIdentifier<TerminationPoint> dtpId = buildTpIdentifier(dstNode, dstTp.getKey());
+ trans.putOperationalData(dtpId, dstTp);
+ LOG.debug("Created TP {} at {} as link destination", dstTp, dtpId);
final InstanceIdentifier<?> lid = buildLinkIdentifier(base, l);
final Link link = lb.build();
Attributes1.class).getAttributeType()).getPrefixAttributes();
final PrefixBuilder pb = new PrefixBuilder();
- pb.setPrefix(p.getIpReachabilityInformation());
+ final IpPrefix ippfx = p.getIpReachabilityInformation();
+ pb.setKey(new PrefixKey(ippfx));
+ pb.setPrefix(ippfx);
if (pa != null) {
pb.setMetric(pa.getPrefixMetric().getValue());
}