use of org.opendaylight.yangtools.yang.data.api.schema.ContainerNode in project bgpcep by opendaylight.
the class BmpRouterPeerImpl method createMirrors.
private static ContainerNode createMirrors(final Mirror mirror, final Timestamp timestamp) {
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> builder = Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(Mirrors.QNAME));
builder.withChild(ImmutableNodes.leafNode(PEER_MIRROR_INFORMATION_QNAME, toDom(MirrorInformationCode.forValue(mirror.getTlvs().getMirrorInformationTlv().getCode().getIntValue()))));
builder.withChild(ImmutableNodes.leafNode(PEER_MIRROR_TIMESTAMP_QNAME, timestamp.getValue()));
return builder.build();
}
use of org.opendaylight.yangtools.yang.data.api.schema.ContainerNode in project bgpcep by opendaylight.
the class BmpRouterPeerImpl method createStats.
private static ContainerNode createStats(final Stat stat, final Timestamp timestamp) {
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> builder = Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(Stats.QNAME));
builder.withChild(ImmutableNodes.leafNode(PEER_STATS_TIMESTAMP_QNAME, timestamp.getValue()));
final Tlvs tlvs = stat.getTlvs();
if (tlvs != null) {
statsForTlvs(tlvs, builder);
}
return builder.build();
}
use of org.opendaylight.yangtools.yang.data.api.schema.ContainerNode in project bgpcep by opendaylight.
the class TableContext method writeRoutes.
void writeRoutes(final DOMDataWriteTransaction tx, final MpReachNlri nlri, final Attributes attributes) {
final ContainerNode domNlri = serializeReachNlri(nlri);
final ContainerNode routeAttributes = serializeAttributes(attributes);
this.tableSupport.putRoutes(tx, this.tableId, domNlri, routeAttributes, ROUTES_NODE_ID);
}
use of org.opendaylight.yangtools.yang.data.api.schema.ContainerNode in project bgpcep by opendaylight.
the class AbstractRIBSupportTest method createNlriWithDrawnRoute.
protected final ContainerNode createNlriWithDrawnRoute(final DestinationType destUnreach) {
final MpUnreachNlri mpReach = new MpUnreachNlriBuilder().setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(destUnreach).build()).build();
final Map.Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> result = this.mappingService.toNormalizedNode(MP_UNREACH_IID, mpReach);
return (ContainerNode) result.getValue();
}
use of org.opendaylight.yangtools.yang.data.api.schema.ContainerNode in project bgpcep by opendaylight.
the class AbstractRIBSupportTest method createRoutes.
@SuppressWarnings("checkstyle:OverloadMethodsDeclarationOrder")
protected final Collection<MapEntryNode> createRoutes(final DataObject routes) {
Preconditions.checkArgument(routes.getImplementedInterface().equals(this.abstractRIBSupport.routesContainerClass()));
final InstanceIdentifier<DataObject> routesIId = routesIId();
final Map.Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> normalizedNode = this.mappingService.toNormalizedNode(routesIId, routes);
final ContainerNode container = (ContainerNode) normalizedNode.getValue();
final NodeIdentifier routeNid = new NodeIdentifier(getRouteListQname());
return ((MapNode) container.getChild(routeNid).get()).getValue();
}
Aggregations