Exemplo n.º 1
0
 /**
  * Submits this topology sample using the provided submitter
  *
  * @throws Exception If there are any problems submitting the data for this class.If there are any
  *     problems submitting the data for this class.
  */
 public void submit(
     com.quest.glue.api.services.TopologyDataSubmissionService3.TopologySubmitter3 submitter,
     UnitService unitService,
     long frequency,
     long timestamp)
     throws TopologyException {
   submitter.setTopologyFormat("5.5.5.1");
   final TopologyNode node = submitter.createTopLevelNode("__top_of_tree__", frequency);
   final TopologyNode _obj_root_node = node.createNode(__getNodeName());
   _obj_root_node.setId(__getNodeId().toString());
   final Set<UUID> submitted = new HashSet<UUID>();
   addToNodeTree(_obj_root_node, unitService, submitted);
   submitter.submit(timestamp);
 }
Exemplo n.º 2
0
 /**
  * Adds the relevant portions of this topology sample using the provided node.
  *
  * @param submitted Set of objects that have already been submitted
  * @param currentNode This node currently being submitted
  * @param unitService An instance of the unit service for converting units.
  * @throws TopologyException If there are any problems submitting the data for this class.
  */
 @Override
 protected void addPropertiesToNodeTree(
     TopologyNode currentNode, UnitService unitService, Set<UUID> submitted)
     throws TopologyException {
   super.addPropertiesToNodeTree(currentNode, unitService, submitted);
   if (!(_name == null)) {
     final TopologyValue _value104 = currentNode.createValue("name");
     _value104.setSampleValue(_name.toString());
     if (__isIdentity("name")) {
       _value104.setIsIdentity(true);
     }
   }
   if (!(_ipAddress == null)) {
     final TopologyNode _node105 = currentNode.createNode("ipAddress");
     if (__isIdentity("ipAddress")) {
       _node105.setIsIdentity(true);
     }
     if (submitted.contains(_ipAddress.__getNodeId())) {
       // field already submitted, just set the reference ID
       _node105.setRefId(_ipAddress.__getNodeId().toString());
     } else {
       // Not already submitted, send the entire thing
       _node105.setTypeHint(_ipAddress.__getNodeName());
       _node105.setId(_ipAddress.__getNodeId().toString());
       _ipAddress.addToNodeTree(_node105, unitService, submitted);
     }
   }
   if (!(_macAddress == null)) {
     final TopologyValue _value106 = currentNode.createValue("macAddress");
     _value106.setSampleValue(_macAddress.toString());
     if (__isIdentity("macAddress")) {
       _value106.setIsIdentity(true);
     }
   }
   if (!(_interfaceIndex == null)) {
     final TopologyValue _value107 = currentNode.createValue("interfaceIndex");
     _value107.setSampleValue(_interfaceIndex);
     if (__isIdentity("interfaceIndex")) {
       _value107.setIsIdentity(true);
     }
   }
   if (!(_portNumber == null)) {
     final TopologyValue _value108 = currentNode.createValue("portNumber");
     _value108.setSampleValue(_portNumber);
     if (__isIdentity("portNumber")) {
       _value108.setIsIdentity(true);
     }
   }
   if (!(_interfaceType == null)) {
     final TopologyValue _value109 = currentNode.createValue("interfaceType");
     _value109.setSampleValue(_interfaceType.toString());
     if (__isIdentity("interfaceType")) {
       _value109.setIsIdentity(true);
     }
   }
   if (!(_netmask == null)) {
     final TopologyValue _value110 = currentNode.createValue("netmask");
     _value110.setSampleValue(_netmask.toString());
     if (__isIdentity("netmask")) {
       _value110.setIsIdentity(true);
     }
   }
   if (!(_isLayer2 == null)) {
     final TopologyValue _value111 = currentNode.createValue("isLayer2");
     _value111.setSampleValue(_isLayer2.toString());
     if (__isIdentity("isLayer2")) {
       _value111.setIsIdentity(true);
     }
   }
   if (!(_networkSegment == null)) {
     final TopologyValue _value112 = currentNode.createValue("networkSegment");
     _value112.setSampleValue(_networkSegment.toString());
     if (__isIdentity("networkSegment")) {
       _value112.setIsIdentity(true);
     }
   }
   if (!(_layer2Segment == null)) {
     final TopologyValue _value113 = currentNode.createValue("layer2Segment");
     _value113.setSampleValue(_layer2Segment);
     if (__isIdentity("layer2Segment")) {
       _value113.setIsIdentity(true);
     }
   }
   if (!(_discoveryStatus == null)) {
     final TopologyValue _value114 = currentNode.createValue("discoveryStatus");
     _value114.setSampleValue(_discoveryStatus.getValue());
     if (__isIdentity("discoveryStatus")) {
       _value114.setIsIdentity(true);
     }
   }
   if (!(_networks == null)) {
     for (TopologyObject list_element : _networks) {
       final TopologyNode _node115 = currentNode.createNode("networks");
       if (__isIdentity("networks")) {
         _node115.setIsIdentity(true);
       }
       if (_replace_networks) {
         _node115.setReplace(true);
       }
       _replace_networks = false;
       if (submitted.contains(list_element.__getNodeId())) {
         // field already submitted, just set the reference ID
         _node115.setRefId(list_element.__getNodeId().toString());
       } else {
         // Not already submitted, send the entire thing
         _node115.setTypeHint(list_element.__getNodeName());
         _node115.setId(list_element.__getNodeId().toString());
         list_element.addToNodeTree(_node115, unitService, submitted);
       }
     }
   }
   if (!(_bandwidth == null)) {
     final TopologyNode _node116 = currentNode.createNode("bandwidth");
     _bandwidth.submit(_node116, unitService.getUnits("bit/second"));
   }
   if (!(_utilization == null)) {
     final TopologyNode _node117 = currentNode.createNode("utilization");
     _utilization.submit(_node117, unitService.getUnits("percent"));
   }
   if (!(_packetsSent == null)) {
     final TopologyNode _node118 = currentNode.createNode("packetsSent");
     _packetsSent.submit(_node118, unitService.getUnits("count/second"));
   }
   if (!(_packetsReceived == null)) {
     final TopologyNode _node119 = currentNode.createNode("packetsReceived");
     _packetsReceived.submit(_node119, unitService.getUnits("count/second"));
   }
   if (!(_sendRate == null)) {
     final TopologyNode _node120 = currentNode.createNode("sendRate");
     _sendRate.submit(_node120, unitService.getUnits("bit/second"));
   }
   if (!(_receiveRate == null)) {
     final TopologyNode _node121 = currentNode.createNode("receiveRate");
     _receiveRate.submit(_node121, unitService.getUnits("bit/second"));
   }
   if (!(_inboundPacketsDropped == null)) {
     final TopologyNode _node122 = currentNode.createNode("inboundPacketsDropped");
     _inboundPacketsDropped.submit(_node122, unitService.getUnits("count"));
   }
   if (!(_outboundPacketsDropped == null)) {
     final TopologyNode _node123 = currentNode.createNode("outboundPacketsDropped");
     _outboundPacketsDropped.submit(_node123, unitService.getUnits("count"));
   }
   if (!(_inboundErrors == null)) {
     final TopologyNode _node124 = currentNode.createNode("inboundErrors");
     _inboundErrors.submit(_node124, unitService.getUnits("count"));
   }
   if (!(_outboundErrors == null)) {
     final TopologyNode _node125 = currentNode.createNode("outboundErrors");
     _outboundErrors.submit(_node125, unitService.getUnits("count"));
   }
   if (!(_outputQueueLength == null)) {
     final TopologyNode _node126 = currentNode.createNode("outputQueueLength");
     _outputQueueLength.submit(_node126, unitService.getUnits("count"));
   }
 }