Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<nmwg:message id="msg4_resp" messageIdRef="msg4"
  type="MetadataKeyResponse" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
  <nmwg:metadata id="meta31">
    <netutil:subject id="subject31" xmlns:netutil="http://ggf.org/ns/nmwg/characteristic/utilization/2.0/">
      <nmwgt:interface xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/">
        <nmwgt:hostName>rt1.bud.hu.geant2.net</nmwgt:hostName>
        <nmwgt:ifName>so-0/1/0</nmwgt:ifName>
        <nmwgt:ifDescription>Link to ISTF 1 (Pr:T-Systems Id:041/3002)</nmwgt:ifDescription>
        <nmwgt:ifAddress type="ipv4">62.40.124.109</nmwgt:ifAddress>
        <nmwgt:direction>in</nmwgt:direction>
        <nmwgt:authRealm>GEANT2</nmwgt:authRealm>
        <nmwgt:capacity>155520000</nmwgt:capacity>
      </nmwgt:interface>
    </netutil:subject>
    <nmwg:parameters id="localhost.localdomain.35530a35:111c3d9794a:1360">
      <nmwg:parameter name="supportedEventType">http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:parameter>
    </nmwg:parameters>
  </nmwg:metadata>
  <nmwg:metadata id="meta5">
    <netutil:subject id="subject5" xmlns:netutil="http://ggf.org/ns/nmwg/characteristic/utilization/2.0/">
      <nmwgt:interface xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/">
        <nmwgt:hostName>rt1.gen.ch.geant2.net</nmwgt:hostName>
        <nmwgt:ifName>ge-7/1/0</nmwgt:ifName>
        <nmwgt:ifDescription>Link to Switch (Pr:x Id:x)</nmwgt:ifDescription>
        <nmwgt:ifAddress type="ipv4">62.40.124.21</nmwgt:ifAddress>
        <nmwgt:direction>in</nmwgt:direction>
        <nmwgt:authRealm>GEANT2</nmwgt:authRealm>
        <nmwgt:capacity>10000000000</nmwgt:capacity>
      </nmwgt:interface>
    </netutil:subject>
    <nmwg:parameters id="localhost.localdomain.35530a35:111c3d9794a:12d1">
      <nmwg:parameter name="supportedEventType">http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:parameter>
    </nmwg:parameters>
  </nmwg:metadata><nmwg:data id="data5" metadataIdRef="meta5">
    <nmwg:key id="localhost.localdomain.35530a35:111c3d9794a:153f">
      <nmwg:parameters id="localhost.localdomain.35530a35:111c3d9794a:1540">
        <nmwg:parameter name="dataSource">ds0</nmwg:parameter>
        <nmwg:parameter name="file">/home/taksometro/cricket-data/bandwidth/rt1.lux.lu.geant2.net/ge-1_0_0_0.rrd</nmwg:parameter>
        <nmwg:parameter name="eventType" value="http://ggf.org/ns/nmwg/characteristic/utilization/2.0"/>
        <nmwg:parameter name="valueUnits">Bps</nmwg:parameter>
      </nmwg:parameters>
    </nmwg:key>
  </nmwg:data>
  <nmwg:data id="data31" metadataIdRef="meta31">
    <nmwg:key id="localhost.localdomain.35530a35:111c3d9794a:14fd">
      <nmwg:parameters id="localhost.localdomain.35530a35:111c3d9794a:14fe">
        <nmwg:parameter name="dataSource">ds0</nmwg:parameter>
        <nmwg:parameter name="file">/home/taksometro/cricket-data/bandwidth/rt1.bud.hu.geant2.net/so-0_3_0.rrd<rtd</nmwg:parameter>
        <nmwg:parameter name="eventType" value="http://ggf.org/ns/nmwg/characteristic/utilization/2.0"/>
        <nmwg:parameter name="valueUnits">Bps</nmwg:parameter>
      </nmwg:parameters>
    </nmwg:key> </nmwg:message>

...

Code Block
org.ggf.ns.nmwg.base.Message message = 
XMLUtils.convertToMessage(metadata_response_dom, "path/to/objects.conf"); {\\}

org.ggf.ns.nmwg.base.Metadata metadata = {\\}
 message.getMetadataArray()[0];
  // Lets assume if we want to show the capacity of
  // the first metadata in responseorgresponse
org.ggf.ns.nmwg.topology.v2_0.Interface iface = \
  metadata.getSubject.getInterface(); 
System.out.println (iface.getCapacityElement().getCapacity);
  // it will return the capacity in String