コード例 #1
0
  public BgpAwareIGPWO(int asId, List<Integer> tmIds) {
    this(asId);

    ObjectFactory factory = new ObjectFactory();
    List list = this.getTrafficMatrix();
    for (Iterator<Integer> iter = tmIds.iterator(); iter.hasNext(); ) {
      int tmId = iter.next();
      try {
        IGPWOCalculateWeightsType.TrafficMatrixType tm =
            factory.createIGPWOCalculateWeightsTypeTrafficMatrixType();
        tm.setTMID(tmId);
        list.add(tm);
      } catch (JAXBException e) {
        logger.error(
            "JAXBException in constructor of IGPWOCalculateWeights. Message: " + e.getMessage());
        if (logger.isDebugEnabled()) {
          e.printStackTrace();
        }
        return;
      }
    }
  }
コード例 #2
0
  public ChartCreation(String id, String collectorName, HashMap<String, String> params) {
    setId(id);

    try {
      ObjectFactory factory = new ObjectFactory();
      CollectorType collector = factory.createChartCreationTypeCollectorType();
      setCollector(collector);
      collector.setName(collectorName);
      if (params == null) {
        return;
      }
      for (Entry<String, String> entry : params.entrySet()) {
        Param param = factory.createParam();
        param.setName(entry.getKey());
        param.setValue(entry.getValue());
        collector.getParam().add(param);
      }
    } catch (JAXBException e) {
      logger.error("JAXBException in constructor of ChartCreation. Message: " + e.getMessage());
      if (logger.isDebugEnabled()) {
        e.printStackTrace();
      }
    }
  }