@Override
 public Map<String, String> getAttributes() {
   HashMap<String, String> result = new HashMap<>();
   if (task != null) {
     result.put("staged_at", task.getStagedAt());
     result.put("started_at", task.getStartedAt());
     result.put("host", task.getHost());
     result.put("ports", StringUtils.collectionToCommaDelimitedString(task.getPorts()));
   }
   return result;
 }
 @Override
 public String getId() {
   return task != null ? task.getId() : (app.getId() + "-failed-" + new Random().nextInt());
 }