示例#1
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.intel.stl.ui.alert.EventBusProcessor#toBusEvent(com.intel.stl.api
  * .notice.EventDescription)
  */
 @Override
 protected PortUpdateEvent toBusEvent(List<EventDescription> evts) {
   Set<PortSource> tmp = new LinkedHashSet<PortSource>(evts.size());
   for (EventDescription evt : evts) {
     IEventSource source = evt.getSource();
     if (source instanceof PortSource) {
       tmp.add((PortSource) source);
     } else {
       log.info("Unsupported event source " + source);
     }
   }
   Iterator<PortSource> it = tmp.iterator();
   int[] lids = new int[tmp.size()];
   short[] ports = new short[tmp.size()];
   for (int i = 0; i < tmp.size(); i++) {
     PortSource ps = it.next();
     lids[i] = ps.getLid();
     ports[i] = ps.getPortNum();
   }
   return new PortUpdateEvent(lids, ports, this);
 }
示例#2
0
  /*
   * (non-Javadoc)
   *
   * @see javax.swing.table.TableModel#getValueAt(int, int)
   */
  @Override
  public Object getValueAt(int pRow, int pCol) {

    Object value = null;

    EventDescription eventMsg = null;
    synchronized (critical) {
      eventMsg = this.mEntryList.get(pRow);
    }
    if (eventMsg == null) {
      return null;
    }

    switch (pCol) {
      case TIME_IDX:
        value = eventMsg.getDate();
        break;

      case SEVERITY_IDX:
        value = eventMsg.getSeverity();
        break;

      case SOURCE_IDX:
        IEventSource source = eventMsg.getSource();
        value = source == null ? STLConstants.K0383_NA.getValue() : source.getDescription();
        break;

      case DESCRIPTION_IDX:
        value = eventMsg.getType();
        break;

      default:
        // NOP
        break;
    } // switch

    return value;
  } // getValueAt