public StateBuilder setPeerAs(AsNumber value) { if (value != null) { checkPeerAsRange(value.getValue()); } this._peerAs = value; return this; } /**
public ConfigBuilder setPeerAs(AsNumber value) { if (value != null) { checkPeerAsRange(value.getValue()); } this._peerAs = value; return this; } /**
public StateBuilder setAs(AsNumber value) { if (value != null) { checkAsRange(value.getValue()); } this._as = value; return this; } /**
@Override public void serializeTlvBody(final AsNumber tlv, final ByteBuf body) { ByteBufWriteUtil.writeUnsignedInt(tlv.getValue(), body); }
public static LocRibWriter create(@Nonnull final RIBSupportContextRegistry registry, @Nonnull final TablesKey tablesKey, @Nonnull final DOMTransactionChain chain, @Nonnull final YangInstanceIdentifier target, @Nonnull final AsNumber ourAs, @Nonnull final DOMDataTreeChangeService service, @Nonnull final PolicyDatabase pd, final CacheDisconnectedPeers cacheDisconnectedPeers, @Nonnull final PathSelectionMode pathSelectionStrategy, @Nonnull final UnsignedInt32Counter routeCounter) { return new LocRibWriter(registry, chain, target, ourAs.getValue(), service, pd, tablesKey, cacheDisconnectedPeers, pathSelectionStrategy, routeCounter); }
static void serializeAsList(final List<AsNumber> asList, final SegmentType type, final ByteBuf byteAggregator) { if (asList == null) { return; } byteAggregator.writeByte(serializeType(type)); byteAggregator.writeByte(asList.size()); for (final AsNumber asNumber : asList) { byteAggregator.writeInt( asNumber.getValue().intValue()); } } }
public StateBuilder setIdentifier(AsNumber value) { if (value != null) { checkIdentifierRange(value.getValue()); } this._identifier = value; return this; } /**
public ConfigBuilder setAs(AsNumber value) { if (value != null) { checkAsRange(value.getValue()); } this._as = value; return this; } /**
public ConfigBuilder setIdentifier(AsNumber value) { if (value != null) { checkIdentifierRange(value.getValue()); } this._identifier = value; return this; } /**
@Override public void serializeTlvBody(final AsNumber tlv, final ByteBuf body) { ByteBufWriteUtil.writeUnsignedInt(tlv.getValue(), body); }
private static ByteBuf putAS4BytesParameterValue(final As4BytesCapability param) { return Unpooled.copyInt(param.getAsNumber().getValue().intValue()); } }
@Override public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) { Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a PathAttribute object."); final List<Communities> communities = ((Attributes) attribute).getCommunities(); if (communities == null || communities.isEmpty()) { return; } final ByteBuf communitiesBuffer = Unpooled.buffer(); for (final Community community : communities) { communitiesBuffer.writeShort(community.getAsNumber().getValue().shortValue()); communitiesBuffer.writeShort(community.getSemantics().shortValue()); } AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL | AttributeUtil.TRANSITIVE, TYPE, communitiesBuffer, byteAggregator); } }
/** * Return a String representing the value of this union. * * @return String representation of this union's value. */ public String stringValue() { if (_ipAddress != null) { return _ipAddress.stringValue(); } if (_ipPrefix != null) { return _ipPrefix.stringValue(); } if (_macAddress != null) { return _macAddress.getValue().toString(); } if (_distinguishedNameType != null) { return _distinguishedNameType.getValue().toString(); } if (_asNumber != null) { return _asNumber.getValue().toString(); } throw new IllegalStateException("No value assinged"); }
/** * Return a String representing the value of this union. * * @return String representation of this union's value. */ public String stringValue() { if (_ipAddress != null) { return _ipAddress.stringValue(); } if (_ipPrefix != null) { return _ipPrefix.stringValue(); } if (_macAddress != null) { return _macAddress.getValue().toString(); } if (_distinguishedNameType != null) { return _distinguishedNameType.getValue().toString(); } if (_asNumber != null) { return _asNumber.getValue().toString(); } throw new IllegalStateException("No value assinged"); }
static ByteBuf serializeSubobject(final AsNumberCase asCase) { final AsNumberSubobject asNumber = asCase.getAsNumber(); final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH); Preconditions.checkArgument(asNumber.getAsNumber() != null, "AsNumber is mandatory."); writeShort(asNumber.getAsNumber().getValue().shortValue(), body); return body; } }
@Override public void serializeBody(final Esi esi, final ByteBuf body) { Preconditions.checkArgument(esi instanceof AsGeneratedCase, "Unknown esi instance. Passed %s. Needed AsGeneratedCase.", esi.getClass()); final AsGenerated asGen = ((AsGeneratedCase) esi).getAsGenerated(); writeUnsignedInt(asGen.getAs().getValue(), body); writeUnsignedInt(asGen.getLocalDiscriminator(), body); body.writeZero(ZERO_BYTE); }
@Override public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) { Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.RedirectAs4ExtendedCommunity, "The extended community %s is not RedirectAs4ExtendedCommunityCase type.", extendedCommunity); final RedirectAs4 redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.RedirectAs4ExtendedCommunity) extendedCommunity).getRedirectAs4(); ByteBufWriteUtil.writeUnsignedInt(redirect.getGlobalAdministrator().getValue(), byteAggregator); ByteBufWriteUtil.writeUnsignedShort(redirect.getLocalAdministrator(), byteAggregator); }
UriBuilder add(final String prefix, final NodeIdentifier node) { if (node.getAsNumber() != null) { add(prefix + "as", node.getAsNumber().getValue()); } if (node.getDomainId() != null) { add(prefix + "domain", node.getDomainId().getValue()); } if (node.getAreaId() != null) { add(prefix + "area", node.getAreaId().getValue()); } add(prefix + "router", formatRouterIdentifier(node.getCRouterIdentifier())); return this; }
private MapEntryNode createPeerEntry(final PeerUpNotification peerUp) { final PeerHeader peerHeader = peerUp.getPeerHeader(); final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> mapEntryBuilder = Builders.mapEntryBuilder() .withNodeIdentifier(new NodeIdentifierWithPredicates(Peer.QNAME, PEER_ID_QNAME, this.peerId.getValue())) .withChild(ImmutableNodes.leafNode(PEER_ID_QNAME, this.peerId.getValue())) .withChild(ImmutableNodes.leafNode(PEER_TYPE_QNAME, peerHeader.getType().name().toLowerCase())) .withChild(ImmutableNodes.leafNode(PEER_ADDRESS_QNAME, getStringIpAddress(peerHeader.getAddress()))) .withChild(ImmutableNodes.leafNode(PEER_AS_QNAME, peerHeader.getAs().getValue())) .withChild(ImmutableNodes.leafNode(PEER_BGP_ID_QNAME, peerHeader.getBgpId().getValue())) .withChild(createPeerSessionUp(peerUp, peerHeader.getTimestampSec())) .withChild( Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(PrePolicyRib.QNAME)) .withChild(ImmutableNodes.mapNodeBuilder(BMP_TABLES_QNAME).build()).build()) .withChild( Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(PostPolicyRib.QNAME)) .withChild(ImmutableNodes.mapNodeBuilder(BMP_TABLES_QNAME).build()).build()); if (peerHeader.getDistinguisher() != null) { mapEntryBuilder.withChild(ImmutableNodes.leafNode(PEER_DISTINGUISHER_QNAME, peerHeader.getDistinguisher().getDistinguisher())); } return mapEntryBuilder.build(); }