@Test public void testCreateSxpNodeId() throws Exception { NodeId nodeId = NodeIdConv.createNodeId("192.168.0.1"); Attribute attribute = AttributeFactory.createSxpNodeId(nodeId); assertEquals(AttributeType.SxpNodeId, attribute.getType()); assertEquals(AttributeVariant.Compact, attribute.getAttributeVariant()); SxpNodeIdAttribute sxpNodeIdAttribute = (SxpNodeIdAttribute) attribute.getAttributeOptionalFields(); assertNotNull(sxpNodeIdAttribute); assertEquals(nodeId, sxpNodeIdAttribute.getSxpNodeIdAttributes().getNodeId()); }
public static Attribute createSxpNodeId(NodeId nodeId) { AttributeBuilder attributeBuilder = new AttributeBuilder(); attributeBuilder.setFlags(getFlags(NONTRANSITIVE_COMPACT)); attributeBuilder.setAttributeVariant(AttributeVariant.Compact); attributeBuilder.setType(AttributeType.SxpNodeId); byte[] value = NodeIdConv.toBytes(nodeId); attributeBuilder.setLength(value.length); attributeBuilder.setValue(value); SxpNodeIdAttributeBuilder _attributeBuilder = new SxpNodeIdAttributeBuilder(); SxpNodeIdAttributesBuilder _attributesBuilder = new SxpNodeIdAttributesBuilder(); _attributesBuilder.setNodeId(nodeId); _attributeBuilder.setSxpNodeIdAttributes(_attributesBuilder.build()); attributeBuilder.setAttributeOptionalFields(_attributeBuilder.build()); return attributeBuilder.build(); }
AttributeFactory { public static Attribute createSxpNodeId(NodeId nodeId) { AttributeBuilder attributeBuilder = new AttributeBuilder(); attributeBuilder.setFlags(getFlags(NONTRANSITIVE_COMPACT)); attributeBuilder.setAttributeVariant(AttributeVariant.Compact); attributeBuilder.setType(AttributeType.SxpNodeId); byte[] value = NodeIdConv.toBytes(nodeId); attributeBuilder.setLength(value.length); attributeBuilder.setValue(value); SxpNodeIdAttributeBuilder _attributeBuilder = new SxpNodeIdAttributeBuilder(); SxpNodeIdAttributesBuilder _attributesBuilder = new SxpNodeIdAttributesBuilder(); _attributesBuilder.setNodeId(nodeId); _attributeBuilder.setSxpNodeIdAttributes(_attributesBuilder.build()); attributeBuilder.setAttributeOptionalFields(_attributeBuilder.build()); return attributeBuilder.build(); } }
AttributeFactory { public static Attribute createSxpNodeId(NodeId nodeId) { AttributeBuilder attributeBuilder = new AttributeBuilder(); attributeBuilder.setFlags(getFlags(NONTRANSITIVE_COMPACT)); attributeBuilder.setAttributeVariant(AttributeVariant.Compact); attributeBuilder.setType(AttributeType.SxpNodeId); byte[] value = NodeIdConv.toBytes(nodeId); attributeBuilder.setLength(value.length); attributeBuilder.setValue(value); SxpNodeIdAttributeBuilder _attributeBuilder = new SxpNodeIdAttributeBuilder(); SxpNodeIdAttributesBuilder _attributesBuilder = new SxpNodeIdAttributesBuilder(); _attributesBuilder.setNodeId(nodeId); _attributeBuilder.setSxpNodeIdAttributes(_attributesBuilder.build()); attributeBuilder.setAttributeOptionalFields(_attributeBuilder.build()); return attributeBuilder.build(); }  }
AttributeFactory { public static Attribute createSxpNodeId(NodeId nodeId) { AttributeBuilder attributeBuilder = new AttributeBuilder(); attributeBuilder.setFlags(getFlags(NONTRANSITIVE_COMPACT)); attributeBuilder.setAttributeVariant(AttributeVariant.Compact); attributeBuilder.setType(AttributeType.SxpNodeId); byte[] value = NodeIdConv.toBytes(nodeId); attributeBuilder.setLength(value.length); attributeBuilder.setValue(value); SxpNodeIdAttributeBuilder _attributeBuilder = new SxpNodeIdAttributeBuilder(); SxpNodeIdAttributesBuilder _attributesBuilder = new SxpNodeIdAttributesBuilder(); _attributesBuilder.setNodeId(nodeId); _attributeBuilder.setSxpNodeIdAttributes(_attributesBuilder.build()); attributeBuilder.setAttributeOptionalFields(_attributeBuilder.build()); return attributeBuilder.build(); }  static Attribute createCapabilities(Version version); static Attribute createHoldTime(int holdTimeMin); static Attribute createHoldTime(int holdTimeMin, int holdTimeMax); static Attribute createIpv4AddPrefix(List<IpPrefix> prefixes, byte flags); static Attribute createIpv4DeletePrefix(List<IpPrefix> prefixes, byte flags); static Attribute createIpv6AddPrefix(List<IpPrefix> prefixes, byte flags); static Attribute createIpv6DeletePrefix(List<IpPrefix> prefixes, byte flags); static Attribute createPeerSequence(List<NodeId> nodesIds); static Attribute createSourceGroupTag(int sgt); static Attribute createSxpNodeId(NodeId nodeId); static byte[] encodeCapability(Capabilities capability); }
AttributeFactory { public static Attribute createSxpNodeId(NodeId nodeId) { AttributeBuilder attributeBuilder = new AttributeBuilder(); attributeBuilder.setFlags(getFlags(NONTRANSITIVE_COMPACT)); attributeBuilder.setAttributeVariant(AttributeVariant.Compact); attributeBuilder.setType(AttributeType.SxpNodeId); byte[] value = NodeIdConv.toBytes(nodeId); attributeBuilder.setLength(value.length); attributeBuilder.setValue(value); SxpNodeIdAttributeBuilder _attributeBuilder = new SxpNodeIdAttributeBuilder(); SxpNodeIdAttributesBuilder _attributesBuilder = new SxpNodeIdAttributesBuilder(); _attributesBuilder.setNodeId(nodeId); _attributeBuilder.setSxpNodeIdAttributes(_attributesBuilder.build()); attributeBuilder.setAttributeOptionalFields(_attributeBuilder.build()); return attributeBuilder.build(); }  static Attribute createCapabilities(Version version); static Attribute createHoldTime(int holdTimeMin); static Attribute createHoldTime(int holdTimeMin, int holdTimeMax); static Attribute createIpv4AddPrefix(List<IpPrefix> prefixes, byte flags); static Attribute createIpv4DeletePrefix(List<IpPrefix> prefixes, byte flags); static Attribute createIpv6AddPrefix(List<IpPrefix> prefixes, byte flags); static Attribute createIpv6DeletePrefix(List<IpPrefix> prefixes, byte flags); static Attribute createPeerSequence(List<NodeId> nodesIds); static Attribute createSourceGroupTag(int sgt); static Attribute createSxpNodeId(NodeId nodeId); static byte[] encodeCapability(Capabilities capability); static final byte COMPACT; static final byte OPTIONAL_COMPACT; static final byte NONTRANSITIVE_COMPACT; }